Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing data back from a Form to UserControl 1

Status
Not open for further replies.

cdraycott

Programmer
Joined
May 24, 2001
Messages
57
Location
GB
Hi,

Can someone help me with a problem i have at the moment. I have an activex control written in VB 6.0 and it has a popup form that a user selects some items in a listbox and then closes the form.

What I want to do is to return the items that we chosen in the listbox on the form to a listbox on the activex usercontrol form.

Is this possible?


Thanks in advance

 
cdraycott,

Use parameters. Either use ByRef (by reference) or use a return parameter. You can set up an array of strings that gets filled from the ActiveX form and then gets returned to the calling function. The array can then be parsed and the strings can be added to the listbox on the calling form.

Then you can use the Ubound functions to keep your code totally dynamic.

Hope that helps a bit.

-crater
 
SmokingCrater,

Do you mean that i need to pass the array in the form.Show method.

That is how i call the form:
Private Sub cmdFormLoad_Click()

frm.Show
End Sub

How do I get the data from the form, could you possibly show an example please


Thanks
 
cdraycott,

Do you have an email? It'll be easier for me to email you my example. You can run it and see how it works.

 
SmokingCrater,

Email me on c_draycott@hotmail.com

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top