|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Custom control class defaults ?Hi NG,
I made some custom control classes, for example a "CommonButton" ... Now I want the button be larger than the default width and height. It works at runtime (by overriding the InitLayout) ... but I also want it at design time when I drag the "CommonButton" on a form ... It always has the default size/name/etc. Anyone have any suggestions ? Thanks in advance! Greets, Philipp "Philipp" <sty***@hotmail.com.invalid> wrote in message The default size when you drag a custom control onto a form is the size of news:uWcJTeygGHA.4080@TK2MSFTNGP03.phx.gbl... > Hi NG, > > I made some custom control classes, for example a "CommonButton" ... Now I > want the button be larger than the default width and height. > It works at runtime (by overriding the InitLayout) ... but I also want it > at design time when I drag the "CommonButton" on a form ... It always has > the default size/name/etc. the control when you compiled it... Show quote > > Anyone have any suggestions ? > > Thanks in advance! > > Greets, > Philipp > > The default size when you drag a custom control onto a form is the size of It's a component class, how do I set the size in the code ?> the control when you compiled it... Thanks Philipp "Philipp" <sty***@hotmail.com.invalid> wrote in message A component.... typically doesn't have a size. What is the base class?news:OPzvZZ7gGHA.4708@TK2MSFTNGP04.phx.gbl... > >> The default size when you drag a custom control onto a form is the size >> of >> the control when you compiled it... > > It's a component class, how do I set the size in the code ? You typically set the size in the designer using the drag handles, and the designer writes a line of code in the InitializeComponent() method in the mycontrol.Designer.cs file. Looks something like: this.ClientSize = new System.Drawing.Size(292, 268); Show quote > > Thanks > > Philipp > > You typically set the size in the designer using the drag handles, and the That's it!> designer writes a line of code in the InitializeComponent() method in the > mycontrol.Designer.cs file. > > Looks something like: > this.ClientSize = new System.Drawing.Size(292, 268); I had that piece of code in the wrong place ... Thanks!!! Philipp |
|||||||||||||||||||||||