如何使用图像作为Windows窗体应用程序的超链接。 [英] How to use a image for a hyperlink for windows forms application.

查看:76
本文介绍了如何使用图像作为Windows窗体应用程序的超链接。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将图像添加到C#中,在点击时将(超链接)连接到网站,就像我说 http://www.codeproject.com/



我更改了Linklabel的图像,但linklabel的文本也显示在表单中;但我想只显示要显示的表单中的图像。

关于linklabel-image的文本删除也没有显示。

我使用代码(下面)并使用linklabel的属性更改了图像。



Adding image to windows form in C# that connects(Hyperlink) to a website when clicked like I say http://www.codeproject.com/

I changed image of Linklabel but the text of linklabel is also displayed in the form;But I want to show only image in the form to be displayed.
On text deletion of linklabel-image is also not displayed.
I used code(below)and changed image using properties of linklabel.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace linklabelcontrols
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // Add a link to the LinkLabel.
            LinkLabel.Link link = new LinkLabel.Link();
            link.LinkData = "http://www.codeproject.com";
            linkLabel1.Links.Add(link);
        }

        private void linkLabel1_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e)
        { //now connection process start here
            Process.Start(e.Link.LinkData as string);
        }
    }
}

推荐答案

图像 [ ^ ]属性做你想做的事?
Does the Image[^] property do what you want?


我想要这个程序的解决方案或者这个程序的输出

请发给我
i want the solution of this program or output of this program
please send the me


这篇关于如何使用图像作为Windows窗体应用程序的超链接。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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