如何得到另一个程序中comboBox控件内的当前内容啊....假设句柄已找到..
我用GetWindowText..没用....
用GetText消息又出错.....请大哥们给我一个可以通过的程序段啊...谢谢了..
我用GetWindowText..没用....
用GetText消息又出错.....请大哥们给我一个可以通过的程序段啊...谢谢了..
解决方案 »
- delphi DBimage 读取数据库图片,出现Bitmap image is not valid
- cxgrid中DDLB的实现
- 动态创建access数据库之后,如何释放?
- dll问题
- 如何拷贝文件流中的部分数据呢? 例子如下
- 关于Delphi在工业控制方面的开发问题
- 打印问题————在线等待?!!!!
- Delphi 怎样实现ASP编程?
- 我下載了delphi5安裝程序.怎麼是delphi5.vcd,怎麼才能打開它呢?
- 请问:D5、ADO、SQL 7三层结构,当两个用户同时存档时总出现Cannot create new connection because in manual transaction mode
- 搜索
- 一个比较困难的问题!
As Long, ByVal Msg As Long, wParam As Any, lParam As Any) As LongConst CB_GETCURSEL = &H147
Const CB_GETLBTEXT = &H148
Const CB_GETLBTEXTLEN = &H149
Private Sub Combo1_DropDown()
Timer1.Enabled = True
End Sub
Private Sub Combo1_LostFocus()
Timer1.Enabled = False
End SubPrivate Sub Form_Load()
With Combo1
.AddItem "Item1"
.AddItem "Item2"
.AddItem "Item3"
End With
End SubPrivate Sub Timer1_Timer()
' Display the text of whatever item in combo box Combo1
' is currently selected. If no list box item is selected, say so.
Dim index As Long ' index to the selected item
Dim itemtext As String ' the text of the selected item
Dim textlen As Long ' the length of the selected item's text' Determine the index of the selected item.
index = SendMessage(Combo1.hwnd, CB_GETCURSEL, ByVal CLng(0), ByVal CLng(0))
' Decide what to do based on that.
Select Case index
Case -1 ' No list box item was selected.
'ToDo
Case Else ' Some item is selected.
' Determine how long the item's text is.
textlen = SendMessage(Combo1.hwnd, CB_GETLBTEXTLEN, ByVal CLng(index), ByVal CLng(0))
' Make enough room in the string to receive the text, including the terminating null.
itemtext = Space(textlen) & vbNullChar
' Retrieve that item's text and display it.
textlen = SendMessage(Combo1.hwnd, CB_GETLBTEXT, ByVal CLng(index), ByVal itemtext)
itemtext = Left$(itemtext, textlen)
Text1.Text = "Selected item: " & itemtext
End SelectEnd Sub
实际上你把ComboBox上的内容发送到公用的模块中就可以
让其他窗口访问乐!