Results 1 to 5 of 5

Thread: [2005] access form by variable or mdichildren

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    81

    [2005] access form by variable or mdichildren

    hello all. If i have name of form(frm1) in a variable (frm_str as string), can i access to the variable like the form? or if i already know the parent of frm1, can i access to it by mdichildren?
    Ex:
    Code:
    dim frm_str as string
    frm_str=frm1.name
    ...
    ...
    ...
    ...
    ...
    frm_str.Show  'this is frm1 actually
    
    or 
    
    dim frm_str as string
    frm_str=frm1.name
    frm1.mdiparent=MainForm
    ...
    ...
    ...
    ...
    ...
    MainForm.MdiChildren(frm_str).show

    any idea? many thank for ur help.

  2. #2
    Addicted Member SidCMC's Avatar
    Join Date
    Jan 2008
    Location
    Mumbai, India
    Posts
    166

    Re: [2005] access form by variable or mdichildren

    Hi...why dont you just make a simple application and run it.
    You will know whether that compiles properly or not.
    Lol,
    Sid.
    THE BEST WAY TO THANK A HELPFUL POST IS TO RATE IT!!!!
    Take up one idea. Make that one idea your life - think of it, dream of it, live on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] access form by variable or mdichildren

    Why do you have a String variable referring to the Name of the form? Why don't you have a Form variable referring to the form itself?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    81

    Re: [2005] access form by variable or mdichildren

    thank u for ur reply. Anyway can i do that?

  5. #5
    Addicted Member SidCMC's Avatar
    Join Date
    Jan 2008
    Location
    Mumbai, India
    Posts
    166

    Re: [2005] access form by variable or mdichildren

    Just create an instance of the form class
    Try this ::

    Dim objform as new Form1()
    objform.show()
    THE BEST WAY TO THANK A HELPFUL POST IS TO RATE IT!!!!
    Take up one idea. Make that one idea your life - think of it, dream of it, live on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone.

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