本文簡(jiǎn)單講述了MFC設(shè)置對(duì)話框焦點(diǎn)的方法,分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
具體的方法有兩種:
1. 設(shè)置對(duì)話框控件的tab order。 按Ctrl+D即可看見。將需要被設(shè)置到焦點(diǎn)的空間的tab order設(shè)為1.
2. 對(duì)話框的OnInitDialog返回FALSE。解釋如下:(摘抄至msdn)
If OnInitDialog returns nonzero, Windows sets the input focus to the first control in the dialog box.
The application can return 0 only if it has explicitly set the input focus to one of the controls in the dialog box.
希望本文所述對(duì)大家的MFC程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選