Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Floating

Very strange behaviour of radio button...

This topic is 5478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I noticed a very strange thing: If a radio button has its "tab stop" option selected and is the first object (or first active object) in the tab order of the dialog, then its function "BN_CLICKED" will automatically be called when the dialog is initialized!!! If there are other radio buttons with exactly the same properties but which come after in the tab order of the dialog, their "BN_CLICKED" functions will not be called. How come? I tried with many different dialogs and it is always the same. I don''t wanna my "BN_CLICKED" function to be called when the user didn''t click the radio button!! Is this a bug or is there a good explanation for this? Meanwhile I just put a button as first object in the tab order to overcome this problem, but I am not happy with that... Thanks for your help

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
try changing the return value in your initdialog from true to false.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
yep, as AP above indicated, it''s due to the response to the WM_INITDIALOG message being returned as TRUE, which tells the Dialog routine that it needs to set the focus to the first control in the tab order. if that control is a radio button, then by definition setting the focus to that radio button causes that radio button''s "clicked event" to be "fired," resulting in the BN_CLICKED message being sent.

if FALSE is returned in response to the WM_INITDIALOG message then the Dialog routine will "assume" that the DialogProc has taken care of setting the focus.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!