我在Check Box 控件事件里面增加了以下两个事件
OnBnKillfocusCheck
OnBnSetfocusCheck
我在点击CheckBox的时候没有进入OnBnSetfocusCheck事件。
CheckBoxMFC控件

解决方案 »

  1.   

    1. 派生 新类。
    2. WM_KILLFOCUS
      

  2.   

    <?xml version="1.0" encoding="UTF-8"?>
    <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"
      xmlns:android="http://schemas.android.com/apk/res/android">
        <LinearLayout android:orientation="horizontal" android:id="@id/loginlayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <EditText android:id="@id/phonenum" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="手机号" android:maxLength="11" android:numeric="integer" android:layout_weight="1.0" />
            <EditText android:id="@id/pwd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="密码" android:password="true" android:maxLength="8" android:numeric="integer" android:layout_weight="1.0" />
            <Button android:id="@id/btnlogin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="登录" android:layout_weight="1.0" />
        </LinearLayout>
        <LinearLayout android:orientation="horizontal" android:id="@id/loginlayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
            <Button android:id="@id/btnhelp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="帮助" android:layout_weight="1.0" />
            <Button android:layout_gravity="left" android:id="@id/btnd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="查询当前" android:layout_weight="1.0" />
            <Button android:layout_gravity="left" android:id="@id/btnd2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="查询上次" android:layout_weight="1.0" />
            <Button android:layout_gravity="left" android:id="@id/btnout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="退出" android:layout_weight="1.0" />
        </LinearLayout>
        <com.baidu.mapapi.map.MapView android:id="@id/bmapView" android:clickable="true" android:layout_width="fill_parent" android:layout_height="fill_parent" />
    </LinearLayout>
      

  3.   

    Check Box 控件的WM_KILLFOCUS 事件怎么不起作用
    CheckBox失去焦点之后也不能触发WM_KILLFOCUS 
      

  4.   

    派生什么新类,能在详细点么。我刚接触MFC感到有点迷茫
      

  5.   

    1:checkbox要响应BN_KILLFOCUS事件而不是WM_KILLFOCUS消息,具体操作资源面板右键控件,然后添加事件处理,SetFocus同样处理。
    2:打开资源面板,在checkbox的属性里,把Notify这个属性设置成true
    派生新类比这稍微麻烦点,而且有点杀鸡用牛刀的感觉,有兴趣LZ也可以试下,方法百度去找