|
-
Dec 10th, 2006, 05:10 PM
#1
[RESOLVED] [2005] Sharing control but preventing dispose?
I have a form with various controls, one of which is a combobox (called "C") which has some significant code behind it.
In a mode of the app, I open a sub-form and need that same combobox on it, rather than copy all of the code into the sub-form, in the load event of the sub-form I did;
VB Code:
Dim CBox As New ComboBox
CBox = Main.C
Which is great, since the sub-form now has the ComboBox and it works fine, I have only one set of code for it too. However... when I close the sub-form with Me.Close and go back to the main form, the ComboBox Main.C is now gone, presumably it was disposed of when the sub-form was closed.
How can I prevent this? I'm assuming there must be a way of sharing controls between forms without having to duplicate them?
Last edited by Bulldog; Dec 10th, 2006 at 05:15 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|