-
November 17th, 2013, 11:04 AM
#1
How to set radioButton to checked without generating an event?
I need to set a radioButon to checked and not generate a CheckedChanged event.
The SendMessageA function doesn't seem to work in this case, probably because I wasn't able to locate a parameter to set the checked state.
Did I just miss it?
Where do I go from here?
Any suggestions?
Thanks!
VS2010
.Net 3.5
Last edited by KKW; November 17th, 2013 at 11:06 AM.
-
November 17th, 2013, 01:29 PM
#2
Re: How to set radioButton to checked without generating an event?
I don't know how it works in C#, but what is wrong with BM_SETCHECK message?
Victor Nijegorodov
-
November 17th, 2013, 01:31 PM
#3
Re: How to set radioButton to checked without generating an event?
SendMessage? Are you attempting to do this within the code of your own program or from a different process? If within the code, then remove the event handler, set the checked state, and re-add the handler.
Code:
myButton.CheckedChanged -= myCheckedChangeHandler(...);
myButton.Checked = true;
myButton.CheckedChanged += myCheckedChandeHandler(...).;
Last edited by Arjay; November 17th, 2013 at 01:43 PM.
-
November 18th, 2013, 08:48 AM
#4
Re: How to set radioButton to checked without generating an event?
Call me daft ( you won't be the first ), but why the need for this in the first place? Isn't an object on the form's sole function to generate some sort of event from the user? Or, am I just reading too much into this?
The problem I can see is that your users will be very confused if the Radio Button doesn't function the way it is supposed to
-
November 18th, 2013, 11:00 AM
#5
Re: How to set radioButton to checked without generating an event?
Hannes, there are cases that you want to initially set a state based on some other user action.
-
November 19th, 2013, 01:15 AM
#6
Re: How to set radioButton to checked without generating an event?
I suppose you're right. Perhaps I'm reading too much in to it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|