Skip to content

mohammed-io/Windows-Forms-Positioning-Tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Windows Forms Positioning Tutorial

It's a tutorial for windows forms positioning

Introduction

In all Windows Forms controls, they there's 4 properties indicates the position of the element relatively to the parent element (i.e. Button to Form).

These are: Left, Top, Right, and Bottom, The Right and Bottom properties are Read Only, their value equals Left + Width and Top + Height respectively.

How do they work?

In fact they are wrappers on Location property, where Left is a wrapper on Location.X, and Top is a wrapper on Location.Y. Location Propery can be set in the propery window, and will give the same result.

The Left property (as descriped in the documentation):

An Int32 representing the distance, in pixels, between the left edge of the control and the left edge of its container's client area.

The Right is a bit different

An Int32 representing the distance, in pixels, between the right edge of the control and the left edge of its container's client area

As you see, the Right = Left + Width

The same for Top and Bottom:

Top: An Int32 representing the distance, in pixels, between the top edge of the control and the top edge of its container's client area. Bottom: An Int32 representing the distance, in pixels, between the bottom edge of the control and the top edge of its container's client area.

About

It's a tutorial for windows forms positioning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published