How to get the handle of a ListBox control in VB.NET 2005?
I am using
Dim i_Handle As ListBox
i_Handle = ListBox1.Han开发者_如何学JAVAdle
But this is not working
You're creating a new ListBox
and setting it to be the value of ListBox1.Handle
- but ListBox1.Handle
returns an IntPrt
type - an integer.
Dim listBoxHandle As IntPtr
listBoxHandle = ListBox1.Handle
MessageBox.Show(listBoxHandle) // You'll see numbers.
Instead of ListBox you must use IntPtr :
Dim i_Handle As IntPtr
i_Handle = ListBox1.Handle
Handle is an IntPrt (A handle is just a 32-bit integer).
精彩评论