VB.NET + MDI

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotr Rendaszka

    VB.NET + MDI

    Hi All!

    I have following problems while working with the VB.NET and MDI forms. I
    have a form that is an MDI Parent and some MDI Child forms that are created
    by the buttons on the parent form.

    The first problem is that I do not really know how to limit the buttons so
    they will be able to open only one instance of specific MDI Child form.

    The second problem is that I do not know how should I reffer to the
    controls/variables that are part of the MDI Child forms. In other words I
    cannot simply allow MDI Child forms to exchange data/variables between
    eachother.

    Can you please help me solving these problems?

    Regards,

    Piotr



  • Cor Ligthert

    #2
    Re: VB.NET + MDI

    Piotr,

    Maybe you can use this. (watch typos a lot is typed in this message)

    \\\
    Private Sub mnuFrmHandling( ByVal frmName As String)
    For Each frm As Form In Me.MdiChildren
    If frm.Name = frmName Then
    frm.BringToFron t()
    Exit Sub
    End If
    Next
    Dim frmNew As Form
    Select Case frmName
    Case "Persons"
    frmNew = New frmPersons
    Case "blabla"
    frmNew = New frmBlaBla ' and all other forms after that
    frmNew.myproper ty = "Hello There"
    Case Else
    frmNew = New frmStandard(frm Name)
    End Select
    frmNew.MdiParen t = Me
    frmNew.Show()
    frmNew.WindowSt ate = FormWindowState .Maximized
    frmNew.Name = frmName
    frmNew.BringToF ront()
    End Sub
    ///

    You can find the parent form in a MDI form by using this in the mdi.
    me.parent. (You cannot go directly from one MDI class (form) to another MDI
    class)

    I hope this helps a little bit?

    Cor
    [color=blue]
    >
    > I have following problems while working with the VB.NET and MDI forms. I
    > have a form that is an MDI Parent and some MDI Child forms that are[/color]
    created[color=blue]
    > by the buttons on the parent form.
    >
    > The first problem is that I do not really know how to limit the buttons so
    > they will be able to open only one instance of specific MDI Child form.
    >
    > The second problem is that I do not know how should I reffer to the
    > controls/variables that are part of the MDI Child forms. In other words I
    > cannot simply allow MDI Child forms to exchange data/variables between
    > eachother.
    >
    > Can you please help me solving these problems?
    >
    > Regards,
    >
    > Piotr
    >
    >
    >[/color]


    Comment

    • Piotr Rendaszka

      #3
      Re: VB.NET + MDI

      thanx rich! i'll tune it up and surly make a use of it!

      Piotr

      U¿ytkownik "Cor Ligthert" <notfirstname@p lanet.nl> napisa³ w wiadomo¶ci
      news:OpZD1fniEH A.3928@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Piotr,
      >
      > Maybe you can use this. (watch typos a lot is typed in this message)
      >
      > \\\
      > Private Sub mnuFrmHandling( ByVal frmName As String)
      > For Each frm As Form In Me.MdiChildren
      > If frm.Name = frmName Then
      > frm.BringToFron t()
      > Exit Sub
      > End If
      > Next
      > Dim frmNew As Form
      > Select Case frmName
      > Case "Persons"[/color]


      Comment

      Working...