C#中的首选项对话框 [英] Preferences Dialog in C#
问题描述
你好,
我在Visual C#中创建一个Web浏览器,我有一个首选项对话框。
当前主页是yahoo.com。主页的代码是:
//回到主页 - 转到默认主页。
WebBrowser thiswebpage = GetCurrentWebBrowser();
thiswebpage.Navigate(" http://www.yahoo.com");
在首选项对话框中,我有一个部分可以更改主页。在那个
部分,我有一个文本框和一个按钮。首选项对话框是一个单独的
窗口。应该在按钮上添加什么代码,以便主页更改为单击按钮时在文本框中键入的网站?
谢谢,
Matt
Hello,
Im creating a Web Browser in Visual C# and I have a preferences dialog. The
current homepage is yahoo.com. The code for the homepage is:
// Go Home - go to the default home page.
WebBrowser thiswebpage = GetCurrentWebBrowser();
thiswebpage.Navigate("http://www.yahoo.com");
On the preferences dialog I have a section to change the homepage. In that
section I have a text box and a button. The Preferences Dialog is a seperate
window. What code should I add to the button so that the homepage changes to
the website I typed in the text box when the button is clicked?
Thank You,
Matt
推荐答案
创建首选项对话框时,传入对浏览器的引用
对象,其中包含URL属性。
当用户单击该按钮时,将新URL分配给此浏览器对象。
-
--- Nick Malik [微软]
MCSD,CFPS,认证Scrummaster
http://blogs.msdn.com/nickmalik
免责声明:本论坛发表的意见是:我自己的,而不是我的雇主的代表。
我不代表我的雇主回答问题。我只是一个帮助程序员的
程序员。
-
" Matt" <马** @ discussions.microsoft.com>在消息中写道
news:61 ********************************** @ microsof t.com ...
when you create the preferences dialog, pass in a reference to the browser
object where you have the URL property.
WHen the user clicks the button, assign the new URL to this browser object.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I''m just a
programmer helping programmers.
--
"Matt" <Ma**@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
你好,
我在Visual C#中创建一个Web浏览器,我有一个首选项对话框。
当前的主页是yahoo.com。主页的代码是:
//返回首页 - 转到默认主页。
WebBrowser thiswebpage = GetCurrentWebBrowser();
thiswebpage.Navigate(" http: //www.yahoo.com");
在首选项对话框中,我有一个部分可以更改主页。在那个
部分,我有一个文本框和一个按钮。首选项对话框是一个
单独的窗口。我应该在按钮上添加什么代码,以便主页在点击按钮时将
更改为我在文本框中输入的网站?
谢谢,
>马特
您好,
感谢您的帮助,但我刚开始并学习在Visual中编程
C#。能否请您更详细地重复说明?
谢谢,
马特
Nick Malik [微软]写道:
Hello,
Thanks for the help but Im just starting and learning to program in Visual
C#. Can you please repeat the instructions in more detail?
Thank You,
Matt
"Nick Malik [Microsoft]" wrote:
当你创建首选项对话框时,传入对你具有URL属性的浏览器
对象的引用。
用户点击按钮的时候,将新URL分配给此浏览器对象。
-
--- Nick Malik [微软]
MCSD,CFPS,认证Scrummaster
http://blogs.msdn.com/nickmalik
免责声明:意见在这个论坛上表达的是我自己的,而不是我雇主的代表。
我不代表我的雇主回答问题。我只是一名帮助程序员的程序员。
-
" Matt" <马** @ discussions.microsoft.com>在消息中写道
新闻:61 ********************************** @ microsof t.com。 ..
when you create the preferences dialog, pass in a reference to the browser
object where you have the URL property.
WHen the user clicks the button, assign the new URL to this browser object.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I''m just a
programmer helping programmers.
--
"Matt" <Ma**@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
你好,
我在Visual C#中创建一个Web浏览器,我有一个首选项对话框。
Hello,
Im creating a Web Browser in Visual C# and I have a preferences dialog.
目前的主页是yahoo.com。主页的代码是:
//返回首页 - 转到默认主页。
WebBrowser thiswebpage = GetCurrentWebBrowser();
thiswebpage.Navigate(" http: //www.yahoo.com");
在首选项对话框中,我有一个部分可以更改主页。在那个
部分,我有一个文本框和一个按钮。 首选项对话框是一个
current homepage is yahoo.com. The code for the homepage is:
// Go Home - go to the default home page.
WebBrowser thiswebpage = GetCurrentWebBrowser();
thiswebpage.Navigate("http://www.yahoo.com");
On the preferences dialog I have a section to change the homepage. In that
section I have a text box and a button. The Preferences Dialog is a
单独的
窗口。我应该在按钮上添加什么代码,以便主页更改
window. What code should I add to the button so that the homepage changes
到
我在单击按钮时在文本框中输入的网站?
谢谢,
Matt
the website I typed in the text box when the button is clicked?
Thank You,
Matt
你在VS安装项目的限制范围内不能真的这样做。
你
可以通过组合一些通用来减少MSI文件的数量
设置
进入一个设置,但每个Web设置都是一个单独的MSI文件。还有
其他
工具可以满足您的需求(这就是InstallShield,Wise,
ZeroG,
AdvancedInstaller等确实如此)
检测帧工作
http://blogs.msdn.com/astebner/archi...14/229574.aspx
设置Bootstrapper
http://www.codeproject.com/dotnet/dotNetInstaller.asp
2005年1月12日星期三19:37:05 -0800,马特
< Ma ** @ discuss.microsoft.com>写道:
You can''t really do that within the constraints of a VS setup project.
You
could reduct the number of MSI files by combining some of the generic
setups
into one setup, but each web setup is a separate MSI file. There are
other
tools that can what you want (which is what InstallShield, Wise,
ZeroG,
AdvancedInstaller etc do)
Detect FrameWork
http://blogs.msdn.com/astebner/archi...14/229574.aspx
Setup Bootstrapper
http://www.codeproject.com/dotnet/dotNetInstaller.asp
On Wed, 12 Jan 2005 19:37:05 -0800, "Matt"
<Ma**@discussions.microsoft.com> wrote:
您好,
感谢您的帮助,但我刚开始并学习用Visual C / C编程。你能否详细重复一下这些说明?
谢谢你,
马克特
尼克马利克[微软]写道:
Hello,
Thanks for the help but Im just starting and learning to program in Visual
C#. Can you please repeat the instructions in more detail?
Thank You,
Matt
"Nick Malik [Microsoft]" wrote:
当你创建首选项对话框时,传入对你具有URL属性的浏览器
对象的引用。
用户点击按钮的时候,将新URL分配给此浏览器对象。
-
--- Nick Malik [微软]
MCSD,CFPS,认证Scrummaster
http://blogs.msdn.com/nickmalik
免责声明:意见在这个论坛上表达的是我自己的,而不是我雇主的代表。
我不代表我的雇主回答问题。我只是一名帮助程序员的程序员。
-
" Matt" <马** @ discussions.microsoft.com>在消息中写道
新闻:61 ********************************** @ microsof t.com。 ..
when you create the preferences dialog, pass in a reference to the browser
object where you have the URL property.
WHen the user clicks the button, assign the new URL to this browser object.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I''m just a
programmer helping programmers.
--
"Matt" <Ma**@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
>你好,
>
>我在Visual C#中创建一个Web浏览器,我有一个首选项对话框。
> Hello,
>
> Im creating a Web Browser in Visual C# and I have a preferences dialog.
>目前的主页是yahoo.com。主页的代码是:
>
> //回家 - 转到默认主页。
> WebBrowser thiswebpage = GetCurrentWebBrowser();
> thiswebpage.Navigate(" http://www.yahoo.com");
>
>在首选项对话框中,我有一个部分来更改主页。在那
>我有一个文本框和一个按钮。首选项对话框是
> current homepage is yahoo.com. The code for the homepage is:
>
> // Go Home - go to the default home page.
> WebBrowser thiswebpage = GetCurrentWebBrowser();
> thiswebpage.Navigate("http://www.yahoo.com");
>
> On the preferences dialog I have a section to change the homepage. In that
> section I have a text box and a button. The Preferences Dialog is a
单独的
>窗口。我应该在按钮上添加什么代码,以便主页更改
> window. What code should I add to the button so that the homepage changes
到
>单击按钮时我在文本框中输入的网站?
>
>谢谢,
>
>马特
> the website I typed in the text box when the button is clicked?
>
> Thank You,
>
> Matt
这篇关于C#中的首选项对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!