| 发表于:2008-01-15 09:32:545楼 得分:0 |
简单:用 2 个 listbox (visible = false): private declare function sendmessagebystring lib _ "user32" alias "sendmessagea" (byval hwnd as long, _ byval wmsg as long, byval wparam as long, _ byval lparam as string) as long private const lb_findstringexact = &h1a2 '在 listbox 中精确查找 private const n as integer = 100 dim i as integer, m as integer private sub form_load() for i = 1 to n list1.additem cstr(i) next i end sub private command1_click() '清除输入 list2.clear end sub private command2_click() '输入数字。如果此按钮设置 default = true, textbox 中回车完成输入 list2.additem text1.text end sub private command1_click() '输出剩余 for i = 0 to list1.listcount - 1 if sendmessagebystring(list2.hwnd, lb_findstringexact, -1, list1.list(i)) > -1 then debug.print list1.list(i) end if next i end sub | | |
|