大佬教程收集整理的这篇文章主要介绍了delphi – ListBox长项提示,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我找到了一个例子:(从http://delphi.about.com/cs/adptips2001/a/bltip0201_4.htm开始)
procedure TForm1.ListBox1MouseMove (Sender: TObject; Shift: TShiftState; X,Y: Integer) ; var lsTindex : Integer ; begin with ListBox1 do begin lsTindex:=Sendmessage(Handle,LB_ITEMFROMPOINT,MakeLParam(x,y)) ; if (lsTindex >= 0) and (lsTindex <= Items.Count) then Hint := Items[lsTindex] else Hint := '' end; end;
它工作,但每次我想查看另一个项目的提示时,我必须将我的鼠标从ListBox移开,然后指向另一个项目以查看其提示.有没有办法在不将鼠标移离ListBox边框的情况下查看每个项目的提示?
var fOldIndex: Integer = -1; procedure TForm1.ListBox1MouseMove (Sender: TObject; Shift: TShiftState; X,y)) ; // this should do the trick.. if fOldIndex <> lsTindex then Application.CancelHint; fOldIndex := lsTindex; if (lsTindex >= 0) and (lsTindex <= Items.Count) then Hint := Items[lsTindex] else Hint := '' end; end;
以上是大佬教程为你收集整理的delphi – ListBox长项提示全部内容,希望文章能够帮你解决delphi – ListBox长项提示所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。