how to check if radio button is click

im just pulling a blank on this one

Page 1 of 1

8 Replies - 47599 Views - Last Post: 20 January 2009 - 07:00 PM Rate Topic: -----

#1 saulfenky2470  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

how to check if radio button is click

Post icon  Posted 14 January 2009 - 08:15 AM

hi, i just spaced on this one. i forgot how to check if a radio button is click or not.

if radiobutton1 = 'what goes here' then
'event stuff



i just need this or else none of my program will work.
Is This A Good Question/Topic? 0
  • +

Replies To: how to check if radio button is click

#2 Christopher Elison  Icon User is offline

  • D.I.C Head

Reputation: 39
  • View blog
  • Posts: 230
  • Joined: 29-December 08

Re: how to check if radio button is click

Posted 14 January 2009 - 08:24 AM

If RadioButton1.Checked = True Then
  MsgBox("RadioButton 1 is checked")
End If


Was This Post Helpful? 1
  • +
  • -

#3 saulfenky2470  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

Re: how to check if radio button is click

Posted 14 January 2009 - 08:26 AM

thank you so much im just really stupit today.
Was This Post Helpful? 0
  • +
  • -

#4 Christopher Elison  Icon User is offline

  • D.I.C Head

Reputation: 39
  • View blog
  • Posts: 230
  • Joined: 29-December 08

Re: how to check if radio button is click

Posted 14 January 2009 - 08:34 AM

Hehe, no problem, and thanks for the thanks! :D
Was This Post Helpful? 0
  • +
  • -

#5 LexBuddha  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 45
  • Joined: 19-November 08

Re: how to check if radio button is click

Posted 16 January 2009 - 07:36 AM

Quick Question based on this question, what if there is multiple Radio buttons or check boxes and based off what check boxes are checked, you want a different result, would you use a loop or a select case statement? I'm not really sure the best application for this....

Lex
Was This Post Helpful? 0
  • +
  • -

#6 saulfenky2470  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

Re: how to check if radio button is click

Posted 20 January 2009 - 08:16 AM

View PostLexBuddha, on 16 Jan, 2009 - 06:36 AM, said:

Quick Question based on this question, what if there is multiple Radio buttons or check boxes and based off what check boxes are checked, you want a different result, would you use a loop or a select case statement? I'm not really sure the best application for this....

Lex


what i did was just use if then statements...
ex
if radiobutton1.checked = true then
messagebox.show("radiobutton1 is checked")
else
if radiobutton2.checked = true then
messagebox.show("radiobutton2 is checked")
else
if radiobutton3.checked = true then
messagebox.show("radiobutton3 is checked")
	 end if
  end if
end if


and it worked fine for me.
Was This Post Helpful? 0
  • +
  • -

#7 citricube  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 73
  • Joined: 21-January 08

Re: how to check if radio button is click

Posted 20 January 2009 - 02:43 PM

View Postsaulfenky2470, on 20 Jan, 2009 - 07:16 AM, said:

View PostLexBuddha, on 16 Jan, 2009 - 06:36 AM, said:

Quick Question based on this question, what if there is multiple Radio buttons or check boxes and based off what check boxes are checked, you want a different result, would you use a loop or a select case statement? I'm not really sure the best application for this....

Lex


what i did was just use if then statements...
ex
if radiobutton1.checked = true then
messagebox.show("radiobutton1 is checked")
else
if radiobutton2.checked = true then
messagebox.show("radiobutton2 is checked")
else
if radiobutton3.checked = true then
messagebox.show("radiobutton3 is checked")
	 end if
  end if
end if


and it worked fine for me.



This Is A Condensed Version Of Your Code



if radiobutton1.checked  then
msgbox("radiobutton1 is checked")
else if radiobutton2.checked  then
messagebox.show("radiobutton2 is checked")
else if radiobutton3.checked then
messagebox.show("radiobutton3 is checked")
end if


This post has been edited by citricube: 20 January 2009 - 02:44 PM

Was This Post Helpful? 0
  • +
  • -

#8 dbasnett  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 110
  • View blog
  • Posts: 609
  • Joined: 01-October 08

Re: how to check if radio button is click

Posted 20 January 2009 - 03:02 PM

this

if radiobutton1.checked = true

is redundant, it should be

if radiobutton1.checked
Was This Post Helpful? 0
  • +
  • -

#9 saulfenky2470  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 70
  • Joined: 11-December 08

Re: how to check if radio button is click

Posted 20 January 2009 - 07:00 PM

all i know is that it works and i dont realy care about short cuts
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1