Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Sharing control but preventing dispose?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2005
    Posts
    1,950

    Resolved [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:
    1. Dim CBox As New ComboBox
    2. 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
  •  



Click Here to Expand Forum to Full Width