永发信息网

在对话框类中的oninitdialog中,return false和return ture的区别是什么

答案:3  悬赏:40  手机版
解决时间 2021-01-26 15:57
  • 提问者网友:喧嚣尘世
  • 2021-01-26 02:56
在对话框类中的oninitdialog中,return false和return ture的区别是什么
最佳答案
  • 五星知识达人网友:等灯
  • 2021-01-26 03:18
MSDN上写的很明白了:
Return Value
Specifies whether the application has set the input focus to one of the controls in the dialog box. 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.

至于应用场合:假设这个Dialog上要求输入内容,如果dialog一弹出来就自动把输入焦点放在第一个编辑框上不就很方便嘛,可以直接输入内容了。这时候OnInitDialog()就需要返回TRUE。
全部回答
  • 1楼网友:街头电车
  • 2021-01-26 04:35
区别在于焦点的设置。 指定对话框是否对它的一个控件设置输入焦点。如果OnInitDialog返回true,Windows将输入焦点设在对话框的第一个控件上,只有在对话框明确将输入焦点设在某控件上,应用返回false。
  • 2楼网友:拾荒鲤
  • 2021-01-26 03:48
MSDN上写的很明白了: Return Value Specifies whether the application has set the input focus to one of the controls in the dialog box. 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. 至于应用场合:假设这个Dialog上要求输入内容,如果dialog一弹出来就自动把输入焦点放在第一个编辑框上不就很方便嘛,可以直接输入内容了。这时候OnInitDialog()就需要返回TRUE。 再看看别人怎么说的。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯