convert textbox text in to hyperlink C# windowForm application -
i want convert textbox string in hyperlink when user click on direct path.
string filepath = @"d:\folder\myfolder" ;
i have tired system.diagnostics.process.start
convert entire textbox think... want particular string only.
{ string filepath = @"d:\folder\myfolder"; textbox3.text += filepath + "\r\n"; textbox3.text += "warnings :" + werr + "\r\n\r\n\r"; textfound = true; }
i think using richtextbox great idea.
1) set detecturls property true , write event handler going {yourformname}.designer.cs below other richtextbox handler write
this.richtextbox1.linkclicked +=
and press tab 2 times. create event handler you.
private void mrichtextbox_linkclicked (object sender, linkclickedeventargs) { // add line inside event handler. system.diagnostics.process.start(e.linktext); //this open click link in default browser. links automatically underlined hyperlinks. }
2)(optional)set multiline property false. make ordinary textbox.
Comments
Post a Comment