如何创建一个弹出窗口,允许我要求用户输入0-1000000(1,000,000)之间的数字? [英] How do I create a pop up windows that will allow me to ask the user to enter a number between 0-1000000 (1,000,000)?

查看:101
本文介绍了如何创建一个弹出窗口,允许我要求用户输入0-1000000(1,000,000)之间的数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在MFC中创建一个免费的单元格游戏.我创建了一个菜单,您可以在菜单"下选择选择游戏..."选项.我在选择游戏..."中添加了一个手柄.

我希望我的句柄代码创建一个弹出窗口,允许用户在文本框中输入一个介于1到1百万之间的数字.我还希望窗口具有单击确定"和取消"的按钮.

现在,如果用户单击确定",我想执行以下操作:

I am creating a free cell game in MFC. I''ve created a menu where you can select under "Menu" the option "Select game...". I''ve added a handle to "Select game...".

I would like my handle code to create a pop up window that will allow the user to enter a number between one and one million in a text box. I would also like the windows to be have an "OK" and "CANCEL" button to click.

Now, if the user clicks "OK," I would like to do the following:

int number = 0;
if(user entered a number in the text box)
{
   number = (number entered into text box)
}
else
{
   // do nothing
}



我希望这很清楚,如果不是这样,请告诉我.

-Aaron



I hope this is clear, if it isn''t, let me know.

-Aaron

推荐答案

遵循此简短
Follow this brief tutorial to learn about modal and modeless dialogs in MFC


这篇关于如何创建一个弹出窗口,允许我要求用户输入0-1000000(1,000,000)之间的数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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