i have dialogbox as a singleton class and on that dialog box i hv 2 radio button on and off which are grouped.when i make on group true in resource and add variable then if i clicked on off radio button and then if i open again that dialog box its focus is on "off" radio button which is right. but when i make "off" button group true i.e. initially its on "off" raio button then if i cliked on "on" button and closed an reopen the dialog focus is neither on "off" nor on "on".i hv used setfocus also but nothing working
You can use SetCheck
to select the proper radio button when the dialog opens and GetCheck
on each radio button to see which is selected. The easier option is to use DDX_Radio
to automatically associate an index with the selection of a radio button.
Get more help from this following MSDN link about button controls
ms-help://MS.MSDNQTR.v90.en/dv_vclib/html/c919d5e6-aeda-49ff-8694-ddaed22e6e54.htm
If I am not wrong with you description, when you close the dialog box you call the destructor. If the dialog is in a 'greater' executable - the dialog is called by another dialog in the same .exe - you can declare the variable as global instead of member (as I suppose is declared).
Otherwise you send data to your .exe by using shared data.
Got the answer:)
suppose i have made two radio button Radio1 and Radio2 under group box then we hv to make group true for first radio button i.e. Radio1 then add varible integer on Radio1 button.If we want focus on Radio2 initially or by default then in constructor of dialogbox on which these radio button exist make variable value as 1 (as index start from 0).
Sorry for the wrong link. Please use below link[link text][1]
http://msdn.microsoft.com/en-us/library/8tba1y6f(VS.80).aspx