Visual C ++表单2010 [英] Visual C++ form 2010

查看:78
本文介绍了Visual C ++表单2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在构建一个程序来发送SMTP邮件.
我有一个问题.
如何制作具有多个按钮的表单,这些按钮会更改表单本身.

让我改一下.

普通程序具有一个主要的窗体"和几个按钮.如果单击按钮,则它们会打开当前窗体,而不是打开其他窗口.

例子.

你有这个.
[ http://img406.imageshack.us/img406/4834/13441708.jpg [ IMG ]

我想知道如何在Visual C ++ 2010表单中执行此操作.

Ty,

Hello,

I''m building a program to sends email''s throw the SMTP.
I have a question.
How can i make a form that has multiple buttons that change the form itself.

Let me rephrase.

Normal programs have a main "form" and several buttons. If you click a button they instead of opening another windows they change the current form.

Example.

You have this.
[IMG]

And if you click in "Registo" it changes the original window.
http://img406.imageshack.us/img406/4834/13441708.jpg[IMG]

I want to know how can i do this in Visual C++ 2010 forms.

Ty,

推荐答案

可以通过将其Visible属性设置为truefalse来显示或不显示表单上的每个项目.因此,您可以在窗体上有许多不同的控件,它们彼此重叠,但是当用户执行某些操作时,只显示一个选中的控件.
Each item on the form can be displayed or not by setting its Visible property to true or false. So you can have a number of different controls on the form overlaying each other but show only one as selected when the user takes some action.


一种实现方法是创建一个用户控件每页".表单右侧的面板将包含当前页面.

您可以通过单击左侧的按钮之一来动态删除旧页面,并在用户进行另一选择时添加新页面.

或者,如果您希望隐藏旧页面并显示新页面.

通常,您的面板还需要功能(或事件),以便在用户单击另一页面的按钮时能够验证该页面,以便在实际显示的页面内容无效的情况下阻止更改.
One way of doing it is to create one user control per "page". A panel on the right side of the form will then contains the current page.

You can dynamically remove old page and add new one when the user do another selection by clicking one of the button on the left side.

Or if you prefer hide old page and show new one.

Typically, your panel would also need functions (or events) to be able to validate a page when the user click on the button of another page so that the change will be prevented if the content of the actually displayed page is not valid.


这篇关于Visual C ++表单2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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