473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Easy to get handle from listbox. How to get listbox from handle?

Hello everyone. This maybe is easy, but I'm stuck.

I'm using visual basic.net. And this is with the enumwindows
function. But that isn't relevant.
If I have a sub that just simply will add an item to a listbox, but
takes the handle to the listbox as a parameter, how can I 'convert'
that handle back to a listbox?

It would look similar to below, except for the line that needs
fixing: lst = new listbox(lstHandle)
Any help? thanks bunches.
DougB

sub main
call addToList(listbox1.handle, "hello")
endsub
sub addToList(lstHandle as intptr, txt as string)
dim lst as listbox
lst = new listbox(lstHandle)
lst.additem (txt)
endsub
Mar 28 '08 #1
0 1386

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: R.Wieser | last post by:
Hello All, I'm trying to get a "Virtual Listbox" to work. I've currently got a form, and used CreateWindowExA to create a ListBox with the LBS_OWNERDRAWFIXED and LBS_NODATA flags on it. I've...
0
by: Carlos Pires | last post by:
When i pass a handle of a listbox to a DLL, and itens are inserted in the listbox, the application crashes whith a "System.ArgumentOutOfRangeException" when i click any of the new itens. A turn...
2
by: Jared | last post by:
Again me Can anyone tell me how to get a handle of a form and using that handle show it? I have MDI application where child forms are all instances of one form. Since I cannot give then...
2
by: louise raisbeck | last post by:
Hi there. I am a little confused. SelectedValue is a property of ListBox and dropdownlist. However it isnt in the list of properties in intellisence (html view i am not talking about code behind...
0
by: Sosh | last post by:
Hi, I'm having a bit of a job getting a handle on a ListBox that i've placed in one column of the footer in a DataGrid. Here's what I've tried so far: - Declaring a protected listbox (with...
1
by: Sven | last post by:
How much entrys can a listbox handle without crashing?
4
by: Brian Henry | last post by:
I have a listbox, and i need to show a text string for selection, but each item is tied to a number (not visible) i need to select the visible text and have it return the number value, i know its...
5
by: PAPutzback | last post by:
Form2 has one purpose to open and list some names and ids. I want to handle the list box click event on form2 so I can get the selected value onto a field in form1. I changed this Dim MyForm2...
3
by: Zytan | last post by:
I can handle DoubleClick on a ListBox to respond, not when the selection changes, but when you double click one to invoke an action. This is the same as using the keys to move the selection, then...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.