如何动态更改自定义对话框文本框 [英] How to change Custom Dialog Textbox dynamically

查看:149
本文介绍了如何动态更改自定义对话框文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Visual Studio安装项目,带有一个带有一个文本框的自定义对话框.此文本框的默认内容应为安装程序启动所在的PC的主机名.我怎样才能做到这一点?如果我重写Install-Method还是需要另一种方法,这可能吗?

谢谢

Hi,

I have a Visual Studio Setup Project, with a Custom Dialog with one Textbox. The default-content of this textbox should be the hostname of the PC, where the Setup was startet. How can I do this? Is this possible, if I override the Install-Method or do I need another way?

Thanks

推荐答案

在调用InitializeComponent()之后将此代码放入表单的构造函数中:

Put this code intot he form''s constructor AFTER the call to InitializeComponent():

string hostName = Dns.GetHostName();
textBox.Text = "PC HostName";






在Google搜索安装项目中的.Net自定义表单"时显示了此链接.它可能有帮助,也可能没有帮助.如果您用谷歌搜索相同的短语,您应该获得308,000次点击.

http://www.c-sharpcorner.com/UploadFile/mgold/CustomInstallMG11102005235312PM/CustomInstallMG.aspx [ ^ ]
A google search for ".Net custom forms in setup project" revealed this link. It may or may not help. You should get about 308,000 hits if you google search the same phrase.

http://www.c-sharpcorner.com/UploadFile/mgold/CustomInstallMG11102005235312PM/CustomInstallMG.aspx[^]


这篇关于如何动态更改自定义对话框文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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