Hallo!
Das Linklabel tut von sich aus gar nichts
Du musst im OnClick-Event selber dafür sorgen, dass sich etwas tut. Hier mal das Beispiel, welches auch in der Dokumentation enthalten ist (ist das im SDK 2.0 hinzugekommen?):
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| private LinkLabel linkLabel1 = new LinkLabel(); public void InitializeMyLinkLabel() { linkLabel1.AutoSize = true; linkLabel1.Location = new System.Drawing.Point(8,16); linkLabel1.Size = new System.Drawing.Size(135,13); linkLabel1.Text = "Click here to get more info.";
linkLabel1.Links.Add(6,4,"www.microsoft.com");
linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
this.Controls.Add(linkLabel1); }
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { linkLabel1.Links[linkLabel1.Links.IndexOf(e.Link)].Visited = true; System.Diagnostics.Process.Start(e.Link.LinkData.ToString()); } |
Ist zwar in C#, sollte Dir aber trotzdem helfen.
Grüße
Christian
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".