Textbox+listbox组成的动态列表
表单1.rar
(3.53 KB)
1、在TEXT上输入,能逐个筛选
2、点combo也能
3、List上,双击鼠标,回车,ESC,能选择
不知道怎么做到像COMBO那样,鼠标在COMBO上移动时,选择的蓝色条跟着动
欢迎大家指点,完善。
of = CREATEOBJECT("form1") of.show(1) DEFINE CLASS form1 as Form AutoCenter = .T. ADD OBJECT list1 as ListBox WITH top=10,left=10,RowSourceType=1,RowSource="101,202,303,404,505,606,707,808,909" PROCEDURE list1.MouseMove(nButton, nShift, nXCoord, nYCoord) nRowHeight = FONTMETRIC(1, this.FontName, this.FontSize); + FONTMETRIC(3, this.FontName, this.FontSize) + 2 nRow = INT((nYCoord - this.Top - 2) / nRowHeight) + 1 this.ListIndex = nRow ENDPROC ENDDEFINE
[此贴子已经被作者于2015-11-24 22:50编辑过]
of = CREATEOBJECT("form1") of.show(1) DEFINE CLASS form1 as Form AutoCenter = .T. ADD OBJECT list1 as ListBox WITH top=10,left=10,RowSourceType=1,; RowSource="101,202,303,404,505,606,707,808,909,202,303,404,505,606,707,808,909,202,303,404,505,606,707,808,909" PROCEDURE list1.MouseMove(nButton, nShift, nXCoord, nYCoord) nRowHeight = FONTMETRIC(1, this.FontName, this.FontSize); + FONTMETRIC(3, this.FontName, this.FontSize) + 2 nRow = INT((nYCoord - this.Top - 2) / nRowHeight) this.ListIndex = nRow + this.TopIndex ENDPROC ENDDEFINE