WPF WebBrowser,文本框,按钮帮助 [英] WPF WebBrowser, TextBox, Button Help

查看:99
本文介绍了WPF WebBrowser,文本框,按钮帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个WPF申请;这是无国界的;仅具有关闭按钮;是完全透明的,包括控件;有一个文本框;一个按钮和一个WebBrowser.

我正在用C#语言编写:

我希望用户能够在TextBox里面写用户名,并将用户名放入一个链接,该链接将保持不变,即. www.examplewebsite.com/[UserNameHere]/websitecode/?#1336424lala

我希望Button能够告诉WebBrowser加载上述样式链接,但要从TextBox中获取UserName并更改该用户的链接.

按钮-> GetUsername->导入链接->浏览器加载该链接.

我知道这是可能的,而且我知道这是一个简单的过程,但我还没有在线找到它.

Hello,

I have a WPF Application; which is borderless; has a close button only; is fully transparent including controls; has one text box; one button and a WebBrowser.

I am writing in Language C#:

I want users to have the ability to write there Username inside the TextBox and for username to be put into a link which will remain constant ie. www.examplewebsite.com/[UserNameHere]/websitecode/?#1336424lala

I want the Button to be able to tell the WebBrowser to load the above style link but grab the UserName from the TextBox and change the link for that user.

Button-->GetUsername-->Implement into link-->Browser load that link.

I know this is possible and I know it is an easy procedure I just haven''t found it online.

推荐答案

0)为Button创建一个Click事件处理程序
1)在点击平均"处理程序中,从文本框中获取用户名
2)确保用户名有效(例如,它不是一个空字符串)
3)使用用户名创建网址.
4)使用 WebBrowser.Navigate [
0) Make a Click event handler for the Button
1) In the Click even handler grab the username from the textbox
2) Make sure the username is valid (e.g. it''s not an empty string)
3) Create the url using the username.
4) Use WebBrowser.Navigate[^]

I hope this helps you, as it''s not really clear to me what exactly your problem is, except that you cannot get the WebBrowser to navigate to your url, solved i the 4th step


这篇关于WPF WebBrowser,文本框,按钮帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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