Click here to Skip to main content
15,910,471 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: how to make a login box ? Pin
tamour22-Apr-08 10:18
tamour22-Apr-08 10:18 
GeneralDrawing on thumbnails Pin
d35tiny21-Apr-08 4:12
d35tiny21-Apr-08 4:12 
GeneralRe: Drawing on thumbnails Pin
led mike21-Apr-08 5:50
led mike21-Apr-08 5:50 
GeneralRe: Drawing on thumbnails Pin
Pete O'Hanlon21-Apr-08 8:50
mvePete O'Hanlon21-Apr-08 8:50 
Questionform controls enlarge Pin
avvaru.murali21-Apr-08 2:00
avvaru.murali21-Apr-08 2:00 
AnswerRe: form controls enlarge Pin
led mike21-Apr-08 5:47
led mike21-Apr-08 5:47 
GeneralRe: form controls enlarge Pin
cocoonwls21-Apr-08 18:30
cocoonwls21-Apr-08 18:30 
GeneralRe: form controls enlarge Pin
Mike Dimmick22-Apr-08 2:24
Mike Dimmick22-Apr-08 2:24 
The simplest approach in .NET is to use the Dock and Anchor properties. If you want to create a toolbar, use the Dock property to place the toolbar at the top. Similarly a 'status bar' could be set to Dock at the bottom. That means that the control is attached to one side of the window, and its size in the other direction is the size of the window (i.e. if docked to the left, the horizontal size is maintained but the vertical size is the size of the window).

Controls within a window can also be Anchored to maintain a set distance from the edge of a window. The default is to anchor top and left, so that as the window is resized, the distances to the top of the window and to the left of the window are maintained. To have the control increase size to the right when the form is made larger horizontally (and shrink when the form shrinks), anchor to the right as well. Similarly you can anchor to the bottom.

To have a control which simply moves to the right and to the bottom, rather than resizing - for example, a button next to a single-line text box - anchor only to the right and bottom, turn left and top anchoring off.

For more complicated layouts, you can split your form up into Panels which can then be anchored, and you can anchor or dock your controls within the Panels. .NET 2.0 adds a FlowLayoutPanel and there is also a TableLayoutPanel for tabular layouts.


DoEvents: Generating unexpected recursion since 1991

Questionhow to resize a windows form ? Pin
tamour21-Apr-08 1:38
tamour21-Apr-08 1:38 
GeneralRe: how to resize a windows form ? Pin
Christian Graus21-Apr-08 18:37
protectorChristian Graus21-Apr-08 18:37 
GeneralRe: how to resize a windows form ? Pin
tamour21-Apr-08 19:33
tamour21-Apr-08 19:33 
GeneralRe: how to resize a windows form ? Pin
Mike Dimmick22-Apr-08 2:32
Mike Dimmick22-Apr-08 2:32 
Question[Message Deleted] Pin
shinboxe21-Apr-08 1:37
shinboxe21-Apr-08 1:37 
GeneralCross post. Please ignore Pin
Pete O'Hanlon21-Apr-08 1:58
mvePete O'Hanlon21-Apr-08 1:58 
QuestionHow retain scrollbar positions of Datagridview? Pin
Guru_yogi20-Apr-08 23:26
Guru_yogi20-Apr-08 23:26 
AnswerRe: How retain scrollbar positions of Datagridview? Pin
Dave Kreskowiak21-Apr-08 3:58
mveDave Kreskowiak21-Apr-08 3:58 
GeneralRe: How retain scrollbar positions of Datagridview? Pin
Guru_yogi22-Apr-08 3:03
Guru_yogi22-Apr-08 3:03 
GeneralRe: How retain scrollbar positions of Datagridview? Pin
Guru_yogi22-Apr-08 21:17
Guru_yogi22-Apr-08 21:17 
GeneralMEDIA PLAYER Pin
varun.g19-Apr-08 4:59
varun.g19-Apr-08 4:59 
GeneralRe: MEDIA PLAYER Pin
Christian Graus20-Apr-08 11:58
protectorChristian Graus20-Apr-08 11:58 
GeneralRe: MEDIA PLAYER Pin
varun.g21-Apr-08 0:50
varun.g21-Apr-08 0:50 
GeneralWSOD Pin
ramki_mars18-Apr-08 1:47
ramki_mars18-Apr-08 1:47 
GeneralRe: WSOD Pin
Rob Smiley18-Apr-08 11:29
Rob Smiley18-Apr-08 11:29 
GeneralRe: WSOD Pin
ramki_mars18-Apr-08 23:37
ramki_mars18-Apr-08 23:37 
GeneralRe: WSOD Pin
Rob Smiley19-Apr-08 0:15
Rob Smiley19-Apr-08 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.