Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: c# if radio button select then  (Read 7243 times)

0 Members and 1 Guest are viewing this topic.

zaryk

  • Guest
c# if radio button select then
« on: April 05, 2008, 07:43:05 PM »
I have a radio button that is selected with

Code: [Select]
InitializeComponent();
docuMents.Select();

I would put more code under it, but im stuck with trying to figure how to do an if(docuMents is selected){}.  Can anyone help?

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: c# if radio button select then
« Reply #1 on: April 06, 2008, 06:28:08 AM »
I don't know much about C# but I would think a radio button would have a checked property.

Code: [Select]
if radiobutton.checked then ...

What software are you using for your program development?

 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

zaryk

  • Guest
Re: c# if radio button select then
« Reply #2 on: April 06, 2008, 06:27:45 PM »
Im using sharpdevelop.....radiobutton.select does select it like I want it too, i suppose i can try using checked but either way I dont have a problem selecting it, just a problem writing an if/then statement for it.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: c# if radio button select then
« Reply #3 on: April 06, 2008, 06:40:05 PM »
I'm thinking select is a method, checked is a property. Use the checked property (true/false) to determine the status of the radio button.

Not sure of the syntax but something like:

if radiobutton.checked = true then do something
if radiobutton.checked = false then do somethingelse

Does SharpDevelop have intellisense or auto-completion? That might prove helpful on listing the properties and methods for a radiobutton.

 8)

The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

zaryk

  • Guest
Re: c# if radio button select then
« Reply #4 on: April 07, 2008, 02:46:51 AM »
cool thanks.....this worked

Code: [Select]
docuMents.Select();

if (docuMents.Checked = true){

« Last Edit: April 08, 2008, 09:06:37 PM by zaryk »