Form size question...

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

    Form size question...

    I have a resizeable form (window) and some controls inside.
    When the form resizes I want the controls to follow.
    So I use this.panel1.Mov e to handle the event.
    But I need to know the size if the working area of the form.
    I have a app. bar, menu and a Status Panel.
    I know that this.Height-75 will give me the correct working height,
    but this look ugly. What when the user use another app. bar height.

    Is there another class to get the correct height AND width of the working
    area in a form?



  • Carlos J. Quintero [.NET MVP]

    #2
    Re: Form size question...

    You have the Size and ClientSize properties... :

    private void Form1_Load(obje ct sender, System.EventArg s e)
    {
    MessageBox.Show (this.Size.ToSt ring());
    MessageBox.Show (this.ClientSiz e.ToString());
    }

    --

    Best regards,

    Carlos J. Quintero

    MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
    You can code, design and document much faster.
    Free resources for add-in developers:
    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.



    "GTi" <gti@gti.com> escribió en el mensaje news:4281f430@n ews.wineasy.se. ..[color=blue]
    >I have a resizeable form (window) and some controls inside.
    > When the form resizes I want the controls to follow.
    > So I use this.panel1.Mov e to handle the event.
    > But I need to know the size if the working area of the form.
    > I have a app. bar, menu and a Status Panel.
    > I know that this.Height-75 will give me the correct working height,
    > but this look ugly. What when the user use another app. bar height.
    >
    > Is there another class to get the correct height AND width of the working
    > area in a form?
    >
    >
    >[/color]


    Comment

    • Alan Pretre

      #3
      Re: Form size question...

      "GTi" <gti@gti.com> wrote in message news:4281f430@n ews.wineasy.se. ..[color=blue]
      > Is there another class to get the correct height AND width of the working
      > area in a form?[/color]

      Can't you use the Anchor settings? WinForms will resize or reposition the
      controls for you.

      -- Alan


      Comment

      • GTi

        #4
        Re: Form size question...

        "Alan Pretre" <alanpretre@new sgroup.nospam> wrote in message
        news:uhSr4kiVFH A.4028@TK2MSFTN GP10.phx.gbl...[color=blue]
        > "GTi" <gti@gti.com> wrote in message news:4281f430@n ews.wineasy.se. ..[color=green]
        >> Is there another class to get the correct height AND width of the working
        >> area in a form?[/color]
        >
        > Can't you use the Anchor settings? WinForms will resize or reposition the
        > controls for you.
        >
        > -- Alan
        >
        >[/color]

        Hi Alan,
        After playing around with the Anchor settings,
        it seems that it is exactly what I want.
        Removing the left settings did it.

        Thanks!!!




        Comment

        Working...