Controls
-
I have a control that expands when pressed. My question is how do I manange/move the other controls so nothing overlaps. Also, how can I add a checkbox to a label before Text label. When I add it to label.Controls I just see the checkbox. And last thing, in my class, I have label.autosize = false; but when I add that control to the form, the VS 2005 sets the autosize property to true. Thanks
-
I have a control that expands when pressed. My question is how do I manange/move the other controls so nothing overlaps. Also, how can I add a checkbox to a label before Text label. When I add it to label.Controls I just see the checkbox. And last thing, in my class, I have label.autosize = false; but when I add that control to the form, the VS 2005 sets the autosize property to true. Thanks
There is no built in support for laying out controls. What you can do is derive from ContainerControl and catch the resize event for all the contained controls. When resize occurs you determine if you need to perform layout. If you do need to perform layout u can do something like this (psuedo-code): int currentx; int currenty; foreach(control c in this.controls) { c.location = new point(currentx, currenty); increment currentx and current y } >> how can i add a checkbox to a label Whats the point of doing that?
-
I have a control that expands when pressed. My question is how do I manange/move the other controls so nothing overlaps. Also, how can I add a checkbox to a label before Text label. When I add it to label.Controls I just see the checkbox. And last thing, in my class, I have label.autosize = false; but when I add that control to the form, the VS 2005 sets the autosize property to true. Thanks
Layout support is added in .NET 2.0 scheduled for release next year. You can download the .NET Framework 2.0 Beta 1 now from http://msdn.microsoft.com/netframework/downloads/updates/default.aspx[^]. You can also download Visual Studio 2005 Express Beta 1 from http://labs.msdn.microsoft.com/vs2005/[^]. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]