473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

State buttons

Hi

Does vs 2005 have buttons that can have two states i.e. depressed and
normal?

Thanks

Regards
Jan 7 '07 #1
4 3493
>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.
Jan 7 '07 #2
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" <ma********************@mvps.orgwrote in message
news:OA**************@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.

Jan 7 '07 #3
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
Jan 7 '07 #4
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" <Jo**@nospam.infovis.co.ukwrote in message
news:eG**************@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" <ma********************@mvps.orgwrote in message
news:OA**************@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.

Jan 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jamey Saunders | last post by:
Hi all, I'm just learning Python (I'm about 8 hours in so far), and I have a problem. I'm writing a small Windows app using Tkinter. I have two buttons on my screen that I want to start in an...
3
by: | last post by:
This is a very open ended question. I have an app with a page that uses link buttons to change the display. On the prior page you have a list of objects. You click one of those objects to see it's...
5
by: melissa.lombard | last post by:
I would like to add dynamic text sizing to a website. There will be three text sizes. When the default is used, only the "Increase text size" button is shown. When the maximum size is used, only...
0
by: Aravind | last post by:
Hi folks. I have a form, frmHistory, which has 3 toggle buttons (1 of which is tglName, which I will be using to demonstrate my problem). The buttons are used to sort the form (explanations...
2
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
2
by: raacampbell | last post by:
Hi, I'm writing a simple Python/Qt3 application and I am trying to write some code in which the user presses a button and the program performs action A or B depending upon the state of a pair of...
3
by: shahoo | last post by:
Hi, I want to simulate the two buttons in a scroll bar, i.e, use two buttons and when the user clicks on them and holds the button, I should scroll. My problem is when the button is clicked, It...
0
by: Homer J. Simpson | last post by:
A few weeks ago I asked for suggestions on how to persist a tree's node state to cookies, without causing postbacks on each click in the tree. I had a single .aspx file, with a row of buttons on...
4
by: _Who | last post by:
I have a master containing radio buttons all with the same group name. If I select one of the buttons and then navigate to a different page the buttons revert to their initial state. Is that...
2
by: test | last post by:
I have asked a sortlike question on this group, but this is an other approach for this problem. I want to send information about a set of 8 radiobuttons to a device that listens to TCP/IP on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.