如何在WPF中使用链接按钮 [英] How to Use Link Button in WPF

查看:77
本文介绍了如何在WPF中使用链接按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows应用程序的WPF中使用链接按钮.

How to Use link Button in WPF in Windows Application.

推荐答案

您是否尝试使用Google搜索"wpf linkbutton"?您将有 丢失 上千个匹配.
Did you try googling "wpf linkbutton"? You would have gotten thousands of hits.


您好,

运行时ASP.NET中的链接按钮就像超链接一样工作,但是您可以通过使用链接按钮生成单击事件来使用链接按钮来编写某些代码,简而言之,链接按钮控件看起来像超链接控件,但就像按钮一样. .

这是一些可以帮助您的代码.

取一个标签和一个链接按钮,然后双击链接按钮以生成其单击事件,然后使用下面给出的代码:

Hello,

Link button in ASP.NET at runtime works like a hyperlink, but you can write certain code with the use of a link button by generating its click event, in short the link button control looks like a hyperlink control but works like a button...

Here is some code that might help you out.

Take a label and a link button and then double click the link button to generate its click event and then use the code given below:

protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Label1.Text = "You clicked a link button";
    }



现在,当您单击链接按钮时,标签的文本将被更改
一旦发现有用,请对我的回答进行评分...

谢谢&问候
基:rose:



Now when you click the link button the text of your label will be changed
Do rate my answer once you find it useful...

Thanks & Regards
Radix :rose:


您可以执行以下操作:

< TextBlock>
<超链接NavigateUri = http://codeproject.com> CodeProject</超链接>
</TextBlock>
You can do this:

<TextBlock>
<Hyperlink NavigateUri=http://codeproject.com>CodeProject</Hyperlink>
</TextBlock>


这篇关于如何在WPF中使用链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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