Results 1 to 8 of 8

Thread: creating a second instance of a form [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    Question creating a second instance of a form [RESOLVED]

    I have run across a bit of a delima (sp?) I have a form, form1, and occasionally, i need to call a second instance of it and call it form2. I need to have form2 reflect form1 ALWAYS so I figure INHERITING form1 would be the answer. I know that if I compile form1 into a .dll, I can call upon it and create form2. BUT, I make changes to form1 on a regular basis.

    If you're still with me, how can i efficiently create form2 and have it stay consistent with form1?
    Last edited by Andy; Mar 25th, 2004 at 10:11 PM.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Are you trying to make a form that looks the same but has different functionality? Or are you just trying to make a copy or 2nd instance of the same form?

    What do you mean by reflecting form1 or staying consistant with?

    Inheritance is intended for extending an object and adding to it or changing it. Inheritance does not really handle syncing instance data between two instances if that is what you need.

  3. #3
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    I can't imagine your reason for wanting to do this ( but perhaps I lack imagination )

    Surely, you cannot inherit from a form instantiated in a project? You can establish a reference to it, so that any changes in either would be reflected in the other.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    ok...more in-depth with my situation:

    I have a form with several tabs across it. One of those tabs has a layout that is used to enter information. Later, when a user wants to see that information again, I want a form to come up and look EXACTLY like that tab does. I would like them to look the same so the user doesnt ever get confused as to where information is. I thought maybe calling it from inheritance or what-not, it would save me a LOT of coding.

    I'd have to make EXACT changes EVERY TIME to form2 if the tab ever changes. I want to avoid that. I COULD simply erase the form, copy all controls from the tab and paste it if thats the case but sometimes, that's a pain too

    Any ideas on what method I should use here?

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Your best bet is probably cut and paste. Inheritance wouldn't really help since you don't want the whole form just that tab. How often will the tab/form change really.

  6. #6
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    How about making a variable reference the tab in question; set all the tabs' visible properties to false; then make the reference variable visible.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    It wont change a lot but There will be updates made to it occassionally. I suppose doing the ol' copy and paste may be the answer.

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    There are was to hack around it but I think they will created more problems then they solve.

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