Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Zadatak_2
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Show_Button_Click(object sender, EventArgs e)
- {
- string title = Naslov_TextBox.Text;
- string message = Tekst_TextBox.Text;
- MessageBoxButtons buttons = MessageBoxButtons.OK;
- if (radOKCancel.Checked) buttons = MessageBoxButtons.OKCancel;
- else if (radYesNo.Checked) buttons = MessageBoxButtons.YesNo;
- else if (radYesNoCancel.Checked) buttons = MessageBoxButtons.YesNoCancel;
- else if (radRetryCancel.Checked) buttons = MessageBoxButtons.RetryCancel;
- else if (radAbortRetryIgnore.Checked) buttons = MessageBoxButtons.AbortRetryIgnore;
- MessageBoxIcon icon = MessageBoxIcon.Asterisk;
- if (radError.Checked) icon = MessageBoxIcon.Error;
- else if (radExclamation.Checked) icon = MessageBoxIcon.Exclamation;
- else if (radHand.Checked) icon = MessageBoxIcon.Hand;
- else if (radInformation.Checked) icon = MessageBoxIcon.Information;
- else if (radNone.Checked) icon = MessageBoxIcon.None;
- else if (radQuestion.Checked) icon = MessageBoxIcon.Question;
- else if (radStop.Checked) icon = MessageBoxIcon.Stop;
- else if (radWarning.Checked) icon = MessageBoxIcon.Warning;
- DialogResult result = MessageBox.Show(message, title, buttons, icon);
- Final_Label.Text = "Pritisnuli ste dugme " + result.ToString();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement