Advertisement
Guest User

Vežba 07, Zadatak 2

a guest
Oct 26th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Zadatak_2
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void Show_Button_Click(object sender, EventArgs e)
  21. {
  22. string title = Naslov_TextBox.Text;
  23. string message = Tekst_TextBox.Text;
  24.  
  25. MessageBoxButtons buttons = MessageBoxButtons.OK;
  26.  
  27. if (radOKCancel.Checked) buttons = MessageBoxButtons.OKCancel;
  28. else if (radYesNo.Checked) buttons = MessageBoxButtons.YesNo;
  29. else if (radYesNoCancel.Checked) buttons = MessageBoxButtons.YesNoCancel;
  30. else if (radRetryCancel.Checked) buttons = MessageBoxButtons.RetryCancel;
  31. else if (radAbortRetryIgnore.Checked) buttons = MessageBoxButtons.AbortRetryIgnore;
  32.  
  33.  
  34. MessageBoxIcon icon = MessageBoxIcon.Asterisk;
  35.  
  36. if (radError.Checked) icon = MessageBoxIcon.Error;
  37. else if (radExclamation.Checked) icon = MessageBoxIcon.Exclamation;
  38. else if (radHand.Checked) icon = MessageBoxIcon.Hand;
  39. else if (radInformation.Checked) icon = MessageBoxIcon.Information;
  40. else if (radNone.Checked) icon = MessageBoxIcon.None;
  41. else if (radQuestion.Checked) icon = MessageBoxIcon.Question;
  42. else if (radStop.Checked) icon = MessageBoxIcon.Stop;
  43. else if (radWarning.Checked) icon = MessageBoxIcon.Warning;
  44.  
  45. DialogResult result = MessageBox.Show(message, title, buttons, icon);
  46.  
  47. Final_Label.Text = "Pritisnuli ste dugme " + result.ToString();
  48. }
  49.  
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement