遍历对话框中所有的控件

    技术2022-05-19  25

    对话框缩放之后,要重画。所以得遍历所有的控件。

    void CSimParDlg::OnButton1() {// TODO: Add your control notification handler code hereCWnd   *pWnd; pWnd=GetWindow(GW_CHILD); while   (pWnd!=NULL) {    if (pWnd-> IsKindOf(RUNTIME_CLASS(CEdit)))       pWnd-> EnableWindow(false);      pWnd=pWnd-> GetNextWindow(); }}

    在对话框中按ctrl+D,编辑各控件的tab值,这样上面程序就会按照tab顺序遍历各个控件

    本文来自:http://hi.baidu.com/nieqingzhen/blog/item/21d9a69a949a76bdc8eaf4fc.html


    最新回复(0)