Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: I can not achieve if statement in my code Pin
Pete O'Hanlon2-May-11 20:11
mvePete O'Hanlon2-May-11 20:11 
GeneralRe: I can not achieve if statement in my code Pin
Keith Barrow2-May-11 23:47
professionalKeith Barrow2-May-11 23:47 
GeneralRe: I can not achieve if statement in my code Pin
#realJSOP3-May-11 4:41
mve#realJSOP3-May-11 4:41 
JokeRe: I can not achieve if statement in my code Pin
Peter_in_27802-May-11 16:18
professionalPeter_in_27802-May-11 16:18 
AnswerRe: I can not achieve if statement in my code Pin
Groulien2-May-11 20:12
Groulien2-May-11 20:12 
AnswerRe: I can not achieve if statement in my code Pin
Thomas Krojer2-May-11 22:37
Thomas Krojer2-May-11 22:37 
QuestionNew to C# - struggling with links + functions + ... etc etc ! Pin
ruby_murray2-May-11 9:10
ruby_murray2-May-11 9:10 
AnswerRe: New to C# - struggling with links + functions + ... etc etc ! Pin
Luc Pattyn2-May-11 9:43
sitebuilderLuc Pattyn2-May-11 9:43 
Hi,

welcome to CodeProject.

Please use PRE tags correctly to show code snippets. You could still edit the existing message.

Your problem is this:
in System.Diagnostics.Process.Start(this.Text); this refers to the instance of the class it is in, i.e. to your Form, and not to the specific LinkLabel you are hoping it refers to. To get that, try this:
LinkLabel link=sender as LinkLabel;
if (link!=null) System.Diagnostics.Process.Start(link.Text); 


I also suggest you add some error handling, so you get a decent response when the file doesn't exist.

Smile | :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.

GeneralRe: New to C# - struggling with links + functions + ... etc etc ! [modified] Pin
BobJanova3-May-11 1:24
BobJanova3-May-11 1:24 
AnswerRe: New to C# - struggling with links + functions + ... etc etc ! [modified] Pin
Steven.Pinto20003-May-11 0:11
Steven.Pinto20003-May-11 0:11 
RantRe: New to C# - struggling with links + functions + ... etc etc ! Pin
Peter_in_27803-May-11 0:42
professionalPeter_in_27803-May-11 0:42 
GeneralRe: New to C# - struggling with links + functions + ... etc etc ! [modified] Pin
Steven.Pinto20004-May-11 23:58
Steven.Pinto20004-May-11 23:58 
QuestionSending and Recieving multiple SMS Pin
Christian_V_V2-May-11 7:11
Christian_V_V2-May-11 7:11 
Question[SOLVED] How to save a D3DImage as a PNG file [modified] Pin
Super Lloyd2-May-11 5:25
Super Lloyd2-May-11 5:25 
Answer[a possible solution] Re: How to save a D3DImage as a PNG file Pin
Super Lloyd2-May-11 7:37
Super Lloyd2-May-11 7:37 
QuestionCA2006 , performance warnings Pin
Subin Mavunkal2-May-11 0:53
Subin Mavunkal2-May-11 0:53 
AnswerRe: CA2006 , performance warnings Pin
I Believe In GOD2-May-11 2:36
I Believe In GOD2-May-11 2:36 
Questionc urgent Pin
hajar802-May-11 0:28
hajar802-May-11 0:28 
AnswerMy vote of 1 PinPopular
Keith Barrow2-May-11 0:45
professionalKeith Barrow2-May-11 0:45 
GeneralRe: My vote of 1 Pin
I Believe In GOD2-May-11 1:24
I Believe In GOD2-May-11 1:24 
AnswerRe: c urgent Pin
PIEBALDconsult2-May-11 2:49
mvePIEBALDconsult2-May-11 2:49 
GeneralRe: c urgent Pin
Keith Barrow2-May-11 3:48
professionalKeith Barrow2-May-11 3:48 
JokeRe: c urgent Pin
Thomas Krojer2-May-11 4:40
Thomas Krojer2-May-11 4:40 
GeneralRe: c urgent Pin
walterhevedeich2-May-11 16:32
professionalwalterhevedeich2-May-11 16:32 
Questionvideo codes c# Pin
naalgo1-May-11 22:50
naalgo1-May-11 22:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.