PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
State buttons
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
State buttons
![]() |
State buttons |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi
Does vs 2005 have buttons that can have two states i.e. depressed and normal? Thanks Regards |
|
|
|
#2 |
|
Guest
Posts: n/a
|
>Does vs 2005 have buttons that can have two states i.e. depressed and
>normal? You can use the CheckBox control with the Appearance property set to Button. Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks but can't work out how to make its size to what I need. No handles to
make it bigger. Manually setting the size in properties does not work either. Thanks Regards "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message news:OAfOUeoMHHA.3552@TK2MSFTNGP03.phx.gbl... > >Does vs 2005 have buttons that can have two states i.e. depressed and >>normal? > > You can use the CheckBox control with the Appearance property set to > Button. > > > Mattias > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
On Sun, 7 Jan 2007 18:36:59 -0000, John wrote:
> Thanks but can't work out how to make its size to what I need. No handles to > make it bigger. Manually setting the size in properties does not work > either. > > Thanks > > Regards Hey John, The width of the checkbox with an appearance of Button will adjust to fit the checkbox text -- Bits.Bytes http://bytes.thinkersroom.com |
|
|
|
#5 |
|
Guest
Posts: n/a
|
John,
As Rad suggests, by default the button will adjust to fit the checkbox & text. You can control this behavior with the AutoSize property. So to answer your original question: >> >Does vs 2005 have buttons that can have two states i.e. depressed and >>>normal? Use a Checkbox with: Appearance = Button AutoSize = False Changing the FlatStyle to Flat you can use the FlatAppearance property to control the colors used by the button. For example, a Green "toggle" button: Me.CheckBox1.Appearance = System.Windows.Forms.Appearance.Button Me.CheckBox1.BackColor = System.Drawing.Color.LightGreen Me.CheckBox1.FlatAppearance.BorderColor = System.Drawing.Color.Green Me.CheckBox1.FlatAppearance.CheckedBackColor = System.Drawing.Color.Green Me.CheckBox1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.DarkGreen Me.CheckBox1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.PaleGreen Me.CheckBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat FWIW: A number of controls gained the AutoSize property in .NET 2.0, if a control is not resizing for you check for this property. -- Hope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "John" <John@nospam.infovis.co.uk> wrote in message news:eG3fQroMHHA.3312@TK2MSFTNGP03.phx.gbl... > Thanks but can't work out how to make its size to what I need. No handles > to make it bigger. Manually setting the size in properties does not work > either. > > Thanks > > Regards > > > "Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message > news:OAfOUeoMHHA.3552@TK2MSFTNGP03.phx.gbl... >> >Does vs 2005 have buttons that can have two states i.e. depressed and >>>normal? >> >> You can use the CheckBox control with the Appearance property set to >> Button. >> >> >> Mattias >> >> -- >> Mattias Sjögren [C# MVP] mattias @ mvps.org >> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com >> Please reply only to the newsgroup. > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

