Results 1 to 5 of 5

Thread: [RESOLVED] How can i create an instance to my form?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Resolved [RESOLVED] How can i create an instance to my form?

    Hi All,
    my application contains a MDI child form on which there will be some picture boxes.. . behind that picture boxes there will be some code also. assume this form as Form1.

    there is a menu option called "new" on my Parent MDI form. suppose a user clicks "New" then a new form should be created(assume this new form as Form2), with the same controls on the old one(Form1)..

    Now my question is ... Is it possible to create a new form "Form2" from "Form1" so that, the Form2 shold resemble as "form1" with the same controls and code...?.. (that means, is there any posibility to create an instance to my form1)

    Thanks:
    retgards:
    raghunadhs

  2. #2
    Lively Member
    Join Date
    Oct 2005
    Posts
    90

    Re: How can i create an instance to my form?

    Hows this?
    this shows an MDI form with form 1 and 2 - you can open new instances...This also shows how to pass data back to the 'instance' form.

    (Compressed/zipped - using WINRAR....)
    Attached Files Attached Files
    Last edited by VBStewart; Aug 21st, 2007 at 03:28 AM.

  3. #3
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Re: How can i create an instance to my form?

    u can use when the new menu item is pressed
    Code:
    public form2 as form
    set form2 = new form1 '(form1 must exist)

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: How can i create an instance to my form?

    Hi AAShis,
    its working thank you. thanks alot..

    Hi VBSTEWART,
    sorry.. i could not be able to see your attached file, when ever i am trying to open , It is saying as "un recognisable file". if have the v.b file regarding to MDI forms. kindly send me that. it may be useful to me.
    Thanks:
    regards:
    raghunadhs

    Quote Originally Posted by aashish_9601
    u can use when the new menu item is pressed
    Code:
    public form2 as form
    set form2 = new form1 '(form1 must exist)

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    167

    Re: How can i create an instance to my form?

    Hi,
    Another thing is... suppose, afterdoing some modifications in form2, user should be able to save the form2 as his own name.. is it possible?

    why i am asking is,through my application my user can be able to develope his own GUI at run time, by dragging and dropping some objects which were created by me. So in form1, i will place those objects(pictures), which will enable the user to drag and drop on the form at any where, and these contains click event also. based on the drag and drop objects(here in the case these are pictures), some actions will be performed. so after completion of every GUI, user can be able to save that form with his own name. and it should be attached to "project explorer"...

    if you know how to do , kindly suggest me. if my question is not clear, kindly let me know that...

    Thanks:
    regards:
    raghunadhs

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