Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Using a textbox or label like a button in c# visual studio
  2. private void txtBox_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
  3. {
  4.     TextBox txtbx = sender as TextBox;
  5.     if (txtbx != null)
  6.     {
  7.         if (txtbx.SelectionLength > 0)
  8.         {
  9.             string seltxt = txtbx.SelectedText;
  10.             //Do Work Here with 'seltxt' variable!
  11.         }
  12.     }
  13. }
  14.        
  15. private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  16.       {
  17.         MessageBox.Show("you have clicked a link label");
  18.         //or whatever action you want it to do.
  19.       }