Showing a form on the click of a MDIparent Menu Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • helpmewithasp
    New Member
    • Nov 2008
    • 3

    Showing a form on the click of a MDIparent Menu Item

    I have designed one MDIParent form with some menus. When I click on the Menu I need to pen a form in the click event of that menu item. The form which will be displayed already exists in the windows application. Please help me with this.
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    You mean something like this?

    Code:
    Private Sub btnMenuStripItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMenuStripItem.Click
                Dim mdiChildForm As New AlreadyExistingForm
                mdiChildForm.MdiParent = Me
                mdiChildForm.WindowState = FormWindowState.Maximized
                mdiChildForm.Show()
    End Sub
    Steven

    Comment

    • helpmewithasp
      New Member
      • Nov 2008
      • 3

      #3
      Originally posted by MrMancunian
      You mean something like this?

      Code:
      Private Sub btnMenuStripItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMenuStripItem.Click
                  Dim mdiChildForm As New AlreadyExistingForm
                  mdiChildForm.MdiParent = Me
                  mdiChildForm.WindowState = FormWindowState.Maximized
                  mdiChildForm.Show()
      End Sub
      Steven

      Thanks a lot Steven but my code is in C#.So can you plz help me out with C# code??

      Comment

      • MrMancunian
        Recognized Expert Contributor
        • Jul 2008
        • 569

        #4
        Originally posted by helpmewithasp
        Thanks a lot Steven but my code is in C#.So can you plz help me out with C# code??
        You'll have to figure that out yourself... Converting VB.NET code to C# should be pretty straight forward.

        Steven

        Comment

        • MrMancunian
          Recognized Expert Contributor
          • Jul 2008
          • 569

          #5
          This is to help you out a little bit:

          Comment

          Working...