CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    78

    Client area of windows Form

    Hello,
    I am developing a MDI form application in C#.
    I want to create some child window form according to the parent Form size.
    To get the height and width of main parent Form i am using "this.ClientSize.Width" & "this.ClientSize.Height", but somehow it is not excluding the size of Toolbar, MenuBar and scrollbar.

    Please tell me the way to find the active client area of a MDI form.


    thanks.
    Gajesh

  2. #2
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: Client area of windows Form

    Just find the the real mdiclient control from the form controls collection and use its clientsize property
    PHP Code:
                foreach (Control ctl in this.Controls)
                {
                    if (
    ctl is MdiClient)
                    {
                        
    MdiClient client ctl as MdiClient;
                        
    Debug.WriteLine(ctl.ClientSize);
                        break;
                    }
                } 

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

Featured