Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MDI form in vb.net 2.0

MDI form in vb.net 2.0

Scheduled Pinned Locked Moved Visual Basic
csharphelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijaylumar
    wrote on last edited by
    #1

    i have a MDI form ina project and it has a child forms my problem is .... when i minimise a child form then automatically the parent i.e Mdi form also minimised how can i do it.... thanks in advance vijay

    C 1 Reply Last reply
    0
    • V vijaylumar

      i have a MDI form ina project and it has a child forms my problem is .... when i minimise a child form then automatically the parent i.e Mdi form also minimised how can i do it.... thanks in advance vijay

      C Offline
      C Offline
      C1AllenS
      wrote on last edited by
      #2

      Hello Vijay, Define a variable in child form of type MDIForm. Dim _mrm As MainForm Now define a function in Child form which takes an argument of type MDIForm. For example: Public Sub parentmin(ByVal mainform As MainForm) _mrm = mainform Me.Show() End Sub Set the following code in the LostFocus() event of the childform Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus _mrm.Focus() _mrm.WindowState = FormWindowState.Minimized End Sub Now From MDIForm, you should call the Child form in the following manner(Lets say on menu button click): Dim frm As New Form1 frm.parentmin(Me) I believe this should help. Regards, Allen

      Allen Smith ComponentOne LLC www.componentone.com

      Z 1 Reply Last reply
      0
      • C C1AllenS

        Hello Vijay, Define a variable in child form of type MDIForm. Dim _mrm As MainForm Now define a function in Child form which takes an argument of type MDIForm. For example: Public Sub parentmin(ByVal mainform As MainForm) _mrm = mainform Me.Show() End Sub Set the following code in the LostFocus() event of the childform Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus _mrm.Focus() _mrm.WindowState = FormWindowState.Minimized End Sub Now From MDIForm, you should call the Child form in the following manner(Lets say on menu button click): Dim frm As New Form1 frm.parentmin(Me) I believe this should help. Regards, Allen

        Allen Smith ComponentOne LLC www.componentone.com

        Z Offline
        Z Offline
        zahedonline
        wrote on last edited by
        #3

        yeah Allen it works perfect ;)

        ZAK

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups