how do i disable radio buttons?  
Author Message
boldeagle





PostPosted: Visual C++ General, how do i disable radio buttons? Top

void CDlg_Log::NoSel(BOOL flag)
{
GetDlgItem(IDC_RADIO1)->EnableWindow(flag);
GetDlgItem(IDC_RADIO2)->EnableWindow(flag);
void CDlg_Log::OnRadio1()
{
// TODO: Add your control notification handler code here
m_rad1 = 0;
NoSel(FALSE);
for (int i=0;i<1000000000;i++)
{
i++;
continue;
}
NoSel(TRUE);

}



void CDlg_Log::OnRadio2()
{
// TODO: Add your control notification handler code here
m_rad1 = 1;
NoSel(FALSE);
for (int i=0;i<1000000000;i++)
{
i++;
continue;
}NoSel(TRUE);

}

radio1 and radio2 are in one group,when i select radio1,i hope both buttons become disabled until the cycle in onradio1 finish.but during the preceture,i press radio2,when the cycle in onradio1 finished,i found radio2 is become selected,why



Visual C++16  
 
 
Bite Qiu - MSFT





PostPosted: Visual C++ General, how do i disable radio buttons? Top

when i select radio1,i hope both buttons become disabled until the cycle in onradio1 finish.but during the preceture,i press radio2,when the cycle in onradio1 finished,i found radio2 is become selected,why

Radio2 of course should become selected because the cycle is finished and you pressed radio2. Is there anything i am missing or not understand

Please notice that this forum is dedicated for visual c++ 2005 and its related features, take a look at this forum's scope:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=19445&SiteID=1

The more appropriate place for your question is probably the MFC newsgroup: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.mfc&lang=en&cr=US

good luck

Bite



 
 
boldeagle





PostPosted: Visual C++ General, how do i disable radio buttons? Top

maybe i didn't discribe the question fully,i mean after i click radio1,both radios become grayed,at this time i click radio2(notice:radio2 is gray now),when the cycle finish in onradio1,both radios become enabled,but u can find radio2 become seleccted now
 
 
Bite Qiu - MSFT





PostPosted: Visual C++ General, how do i disable radio buttons? Top

this elaboration makes sense to me, but as I said, this topic is OTP (Off Topic Post), you will get more attention and response when you post it in right place, good luck :)