Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perform equivalent of radiobutton2.PerformClick()

Status
Not open for further replies.

AustinOne

Programmer
Mar 22, 2002
59
0
0
US
Hi Guys,

Neophyte here.

I have a couple of radio buttons within a panel on the screen.

I need to perform the equivalent of a radiobutton2.PerformClick() to simulate radiobutton2 being selected in an initialization routine.

Unfortunately,I cannot use the radiobutton2.PerformClick() method, as I am using the .Net COMPACT Framework, and this method is not available in .Net CF.

I had actually put together a prototype program using normal Windows Forms and the regular Net Framework, and it works fine (using the PerformClick() method). But now, I am trying to implement this on Win Mobile / Net CF. Surprise! :-(

What to do?
 
Hi,

Your click event ought to CALL a routine that does the stuff that is currently in your event code.

Then just call that same routine when you want that stuff to happen under other circumstances. Easy peazy!
 
Duh! The equivalent is:

radiobutton2.Checked = True

(Smacks forehead with palm of hand. I must have had a brain-lapse.)
 
If you have your logic (or call) in:
[tt]
Private Sub radiobutton2_CheckedChanged(...
[/tt]
event, and your radiobutton2 is already selected, your [tt]radiobutton2.Checked = True
[/tt] will not work because that will not make your radio button 'chanage the checked' status.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top