Advertisement
MusicFreak

Programiranje 11.10.2013

Oct 11th, 2013
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.92 KB | None | 0 0
  1. 1) Napraviti formu sa dugmetom i text boxom i nakon klika na dugme otvori se message box sa opcijama "Yes", "No", "Cancel". Nakon odabira opcije u text boxu u formi ce se ispisati "Izabrali ste Yes/No/Cancel".
  2.  
  3. private void button1_Click(object sender, EventArgs e)
  4.         {
  5.             string poruka = "Pritisnite neko od ovih dugmadi";
  6.             string naslov = "Naslovna linija Dijaloga za poruke";
  7.             MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel;
  8.             MessageBoxIcon ikona = MessageBoxIcon.Information;
  9.  
  10.             DialogResult rez = System.Windows.Forms.MessageBox.Show(poruka, naslov, buttons, ikona);
  11.  
  12.             switch (rez)
  13.             {
  14.                 case DialogResult.Yes:
  15.                     textBox1.Text = "Izabrali ste dugme YES";
  16.                     break;
  17.                 case DialogResult.No:
  18.                     textBox1.Text = "Izabrali ste dugme NO";
  19.                     break;
  20.                 case DialogResult.Cancel:
  21.                     textBox1.Text = "Izabrali ste dugme Cancel";
  22.                     break;
  23.             }
  24.  
  25. 2) Napraviti formu u kojoj se nalazi dugme i klikom na to dugme otvora se Explorer.
  26. Process.Start(" ");
  27.  
  28.         private void button1_Click(object sender, EventArgs e)
  29.         {
  30.             System.Diagnostics.Process.Start("Chrome");
  31.         }
  32.  
  33. ///////////////////////////
  34.  
  35. private void button1_Click(object sender, EventArgs e)
  36.         {
  37.             System.Diagnostics.Process.Start("Chrome");
  38.         }
  39.  
  40.         private void button2_Click(object sender, EventArgs e)
  41.         {
  42.             System.Diagnostics.Process.Start("IEXPLORE");
  43.         }
  44.  
  45.         private void button3_Click(object sender, EventArgs e)
  46.         {
  47.             System.Diagnostics.Process.Start("firefox");
  48.         }
  49.  
  50. 3) Napraviti formu u kojoj imaju dva dugmeta. Klikom na prvo dugme pokrenemo aplikaciju a klikom na drugo dugme ugasimo tu pokrenutu aplikaciju.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement