开发者

how to get the handle of listbox in vb.net 2005

开发者 https://www.devze.com 2022-12-15 04:28 出处:网络
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

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).

0

精彩评论

暂无评论...
验证码 换一张
取 消