Results 1 to 3 of 3

Thread: Help: MDI form & ChildForm (with show dialog)

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    2

    Unhappy Help: MDI form & ChildForm (with show dialog)

    I has 4 form
    1. Main.vb (IsMdiContainer = T)
    2. Form1.vb (has textbox1 , Button1)
    3. Form2.vb (Has button1)
    4. Form3.vb ( has textbox1, button1)

    i start with Main.vb, and show Form1.vb (
    code :
    dim frm1 as new Form1
    frm1.MdiParent = Me
    frm1.show()

    at Frm1 i has 1 textbox (textbox1) and button1, if i clickk button1, form2 show with dialogform
    code:
    at button1 click
    form2.showdialog()

    in form2, i has button1 if i click, form3 show with dialogform too
    code
    form3.showdialog()

    in form3 i has textbox1. and button
    if i clock button1. i'll put textbox1 value into form 1 textbox.
    code :
    at button1 click.

    form1.textbox1.text = me.textbox1.text


    but the textbox1 in form1 not has value ?
    anyone help me ?


    thz

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

    Re: Help: MDI form & ChildForm (with show dialog)

    Default instances strike again. In the case of Form2 and Form3 you are displaying the default instance, yet with Form1 you are explicitly creating an instance, but then you're trying to display text on the default instance. You need to be consistent: either use default instances all the time or not at all; don't mix and match.

    Follow the Blog link in my signature and you'll find a post all about default instances. You should read it.
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2009
    Posts
    2

    Re: Help: MDI form & ChildForm (with show dialog)

    thanks alot

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