Results 1 to 5 of 5

Thread: Mdi Child Load Maximized error

  1. #1

    Thread Starter
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Mdi Child Load Maximized error

    Ok, I am pretty new to VB.Net and I am having some trouble with loading a child form into a Mdi form as Maximized. The form appears to be in the maximized state, but the child form does not fill the entire area unless i minimize it and maximize it again.

    I set the properties of the shild form to WindowState - Maximized and also set it on load like so

    VB Code:
    1. Private Sub lnkAdmin_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkAdmin.LinkClicked
    2.         If pnlAdmin.Visible = False Then
    3.             pnlAdmin.Visible = True
    4.             picSamples.Top = picSamples.Top + 25
    5.             lnkSamples.Top = lnkSamples.Top + 25
    6.             pnlSamples.Top = pnlSamples.Top + 25
    7.             lnkReporting.Top = lnkReporting.Top + 25
    8.             picReporting.Top = picReporting.Top + 25
    9.             pnlReporting.Top = pnlReporting.Top + 25
    10.             picExit.Top = picExit.Top + 25
    11.             lnkExit.Top = lnkExit.Top + 25
    12.             frmAdminHelp.MdiParent = Me 'here is where i set the mdi parent
    13.             frmAdminHelp.WindowState = FormWindowState.Maximized 'Set maximized
    14.             frmAdminHelp.Show()
    15.  
    16.         Else
    17.             pnlAdmin.Visible = False
    18.             picSamples.Top = picSamples.Top - 25
    19.             lnkSamples.Top = lnkSamples.Top - 25
    20.             pnlSamples.Top = pnlSamples.Top - 25
    21.             lnkReporting.Top = lnkReporting.Top - 25
    22.             picReporting.Top = picReporting.Top - 25
    23.             pnlReporting.Top = pnlReporting.Top - 25
    24.             picExit.Top = picExit.Top - 25
    25.             lnkExit.Top = lnkExit.Top - 25
    26.             frmAdminHelp.Dispose()
    27.         End If
    28.     End Sub
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  2. #2
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    263

    Re: Mdi Child Load Maximized error

    Has anyone got a solution to this im having the same issue

    Regards

    Danny

  3. #3
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Mdi Child Load Maximized error

    In 1.1, this worked without a problem:
    VB Code:
    1. Private frm2 As New Form2
    2.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    3.         frm2.MdiParent = Me
    4.         frm2.WindowState = FormWindowState.Maximized
    5.         frm2.Show()
    6.     End Sub
    I'm not sure what the purpose of the extra code is...

  4. #4
    Hyperactive Member
    Join Date
    Feb 2003
    Posts
    263

    Re: Mdi Child Load Maximized error

    So the midparent thing is the extra code

    thats the only like that is different to my code!

  5. #5
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: Mdi Child Load Maximized error

    thats the only like that is different to my code!
    So.... Did it work or still having issues?

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