关于listbox的问题(分不多,但你心情好的话一定要看看)(30分)

  • 主题发起人 smiledog
  • 开始时间
S

smiledog

Unregistered / Unconfirmed
GUEST, unregistred user!
我的listbox怎么不能用右键来选定?
我的listbox支持多选的,另外我在onmousedown中
判断item是位置后,改变其selected的值为true还是不行!
 
我等的花儿都谢了
 
procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
APoint: TPoint;
Index: integer;
begin
if Button = mbRight then
begin
APoint.X := X;
APoint.Y := Y;
Index := ListBox1.ItemAtPos(APoint, True);
ListBox1.Selected[Index] := True;
end;
end;
 
to ArJianzeng 谢谢你,你的方法我试了不行
 
我做的实际上是一个类似东方影都的flash播放器,我的第二个问题是
我要用esc来将最大化的播放窗口(非主窗口)恢复
我将主窗口的keypreview设为true后,可以做到,但是必须先点击主窗口
怎样才能先让主窗口获得焦点。我用过setfocus,bringtofront等就是不行
 
小子,你走运
 
接受答案了.
 
顶部