delphi7 listbox 修改了触发的事件是什么事件??我想修改listbox 时赋值给其它控件;

解决方案 »

  1.   

    俺也想知道。但有解决办法。另开一个线程,判断其Count是否变化;或者定指自己的ListView
      

  2.   

    有办法解决的,用自绘方式,可以触发 OnDrawItem,然后就可以取出当前选择的Item值
    1、设置ListBox.Sytle=lbOwnerDrawFixed
    2、在 OnDrawItem 事件中编写自绘代码即可
    procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
    begin
      (Control as TListBox).Canvas.FillRect(Rect);
      (Control as TListBox).Canvas.TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]);
      Edit1.Text := ListBox1.Items[Index];
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      self.ListBox1.Style := lbOwnerDrawFixed;
    end;