对话焦点不在CheckButton上,而是放在RadioButton组的第一个RadioButton上? [英] Dialog focus is not on checked RadioButton,but on the first RadioButton of a RadioButton Group?

查看:112
本文介绍了对话焦点不在CheckButton上,而是放在RadioButton组的第一个RadioButton上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个groupradio对话框。 groupradio有3个单选按钮(由CButton类定义)

============================== =====
$
A,B,C是一个群组,第一个RadioButton是A $
CButton A;  CButton B;  CButton C;

===================================

I have a dialog with a groupradio. The groupradio has 3 radio buttons(definit by Class CButton)
===================================
A,B,C is a group, the first RadioButton is A
CButton A;  CButton B;  CButton C;
===================================

执行以下步骤:
$ b $b①在此对话框中单击(选中)按钮C(A)


$ b $b②单击对话框(A)中的[确定]按钮,然后打开其他对话框(B)。



③在其他对话框(B)中单击[返回]按钮,然后对话框(A) 
返回并重新显示。$


运行③后,焦点在对话框(A)中的第一个RadioButton(CButton A)上,并且按钮C被检查。

Do following step:
①Button C is clicked(Check on) in this dialog(A)

② [OK] Button is clicked in the dialog(A), then other dialog(B) goes to open.

③[Back] Button is clicked in other dialog(B),then the dialog(A) is returned and re-displayed .

After run ③、the focus is on first RadioButton(CButton A) in the dialog(A), and Button C is checked on .

请参阅以下信息,它是MS规格。 ↓

Refer to below info,it is MS spec. ↓

https://social.msdn.microsoft.com/Forums/vstudio/en-US/116377e1-9eb3-4638- a609-92ed07d81671 / bnclicked-for-focused-focused-but-unchecked-radio-button-when-activatingdeactivating-window?forum = vcgeneral

但是如果我使用xxx。在使用xxx.setcheck(1)之前设置检查(0),避免这种现象。

我想知道为什么xxx.setcheck(0)需要在xxx.setcheck(1)之前? ?

任何想法可能会导致这样

But if I use xxx.setcheck(0) before use xxx.setcheck(1),this phenomenon is avoided.
I want to know Why xxx.setcheck(0) need before xxx.setcheck(1)?
Any ideas what might cause this?

源例:

BOOL CRadioButtonTest :: OnInitDialog中()

{

  //设置单选框 

  kSetCheck(m_dwSelectBtnID);

BOOL CRadioButtonTest::OnInitDialog()
{
 // Set Radiobutton 
 kSetCheck( m_dwSelectBtnID );

  返回TRUE;

  return TRUE;

}

void CRadioButtonTest :: kSetCheck(

  const DWORD dwBtnID      ; // 已检查的RadioButton状态的ID



{

       //A.SetCheck(0);

       //B.SetCheck(0);

        // C.SetCheck(0);

void CRadioButtonTest::kSetCheck(
 const DWORD dwBtnID     // The ID for checked RadioButton Status
)
{
       //A.SetCheck(0);
       //B.SetCheck(0);
       //C.SetCheck(0);

    开关(dwBtnID)

        {

         情况1:  //上状态

&NBSP的检查;                 A.SetCheck(1); 

                  break;

           case 2:  // B查看状态

                  B.SetCheck(1);

                休息;

         情况3:  关于状态

&NBSP // C校验;             &NBSP ;   C.SetCheck(1);

                休息;

     switch( dwBtnID )
       {
          case 1: //A check on status
                 A.SetCheck(1); 
                 break;
          case 2: //B check on status
                 B.SetCheck(1);
                 break;
          case 3:  //C check on status
                 C.SetCheck(1);
                 break;

        默认值:

                  XXX

         打破;

      &NBSP ;  }

}

         default:
                  XXX
         break;
         }
}

推荐答案

你好,

据我所知,SetCheck没有SetFocus。所以当调用SetCheck时,焦点可以保留在任何其他控件上。

as far as I know, SetCheck does not SetFocus. So the focus can stay on any other control when SetCheck is called.

问候,Guido


这篇关于对话焦点不在CheckButton上,而是放在RadioButton组的第一个RadioButton上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆