tags:

views:

48

answers:

6

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

A: 

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.

Mark Ransom
i have used DDX_Radio methode also but its not working.its working when i assciate on button then its not working but when i associate with off button then its not working.the order in which ihv the button on dialog box is first on then off.will order matters?
@user323422, some hints: Make sure your radio buttons are consecutive in the tab order. Set the Group property True on the first radio button, and also on the next control in the tab order after the last radio button (often a group box).
Mark Ransom
The official Microsoft documentation for DDX_Radio is here: http://msdn.microsoft.com/en-us/library/fchz3yh5(VS.80).aspx
Mark Ransom
A: 

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

Raghuram Reddy N
this link is not opening can u please post correct link
A: 

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.

Sunscreen
A: 

I think the original question is about how to set focus, and I think the answer is here. Note that I tried it, and I could not make it work, but it sure looks like the right answer.

Jeff
A: 

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).

A: 

Sorry for the wrong link. Please use below link[link text][1]

http://msdn.microsoft.com/en-us/library/8tba1y6f(VS.80).aspx

Raghuram Reddy N