Public p As New System.Diagnostics.Process
Private Sub RichTextBox1_LinkClicked _
(ByVal sender As Object, ByVal e As _
System.Windows.Forms.LinkClickedEventArgs) _
Handles RichTextBox1.LinkClicked
' Call Process.Start method to open a browser
' with link text as URL.
p = System.Diagnostics.Process.Start("IExplore.exe", e.LinkText)
End Sub
public System.Diagnostics.Process p = new System.Diagnostics.Process();
private void richTextBox1_LinkClicked(object sender,
System.Windows.Forms.LinkClickedEventArgs e)
{
// Call Process.Start method to open a browser
// with link text as URL.
p = System.Diagnostics.Process.Start("IExplore.exe", e.LinkText);
}
public:
System::Diagnostics::Process ^ p;
private:
void richTextBox1_LinkClicked(System::Object ^ sender,
System::Windows::Forms::LinkClickedEventArgs ^ e)
{
// Call Process.Start method to open a browser
// with link text as URL.
p = System::Diagnostics::Process::Start("IExplore.exe",
e->LinkText);
}
p = gcnew System::Diagnostics::Process();
(Visual C#, Visual C++) Place the following code in the form's constructor to register the event handler.
this.richTextBox1.LinkClicked += new
System.Windows.Forms.LinkClickedEventHandler
(this.richTextBox1_LinkClicked);
this->richTextBox1->LinkClicked += gcnew
System::Windows::Forms::LinkClickedEventHandler
(this, &Form1::richTextBox1_LinkClicked);
It is important to immediately stop the process you have created once you have finished working with it. Referring to the code presented above, your code to stop the process might look like this:
Public Sub StopWebProcess()
p.Kill()
End Sub
public void StopWebProcess()
{
p.Kill();
}
public: void StopWebProcess()
{
p->Kill();
}