Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows;
- using System.Windows.Forms;
- using System.Drawing;
- class Blabla {
- public static void Main() {
- Application.EnableVisualStyles();
- Form form1 = new System.Windows.Forms.Form();
- Button button1 = new System.Windows.Forms.Button();
- Button button2 = new System.Windows.Forms.Button();
- button1.Text = "OK";
- button1.Location = new Point (10, 10);
- button2.Text = "Cancel";
- button2.Location = new Point (button1.Left, button1.Height + button1.Top + 10);
- form1.Text = "My Dialog Box";
- form1.HelpButton = true;
- form1.FormBorderStyle = FormBorderStyle.FixedDialog;
- form1.MaximizeBox = false;
- form1.MinimizeBox = false;
- form1.AcceptButton = button1;
- form1.CancelButton = button2;
- form1.StartPosition = FormStartPosition.CenterScreen;
- form1.Controls.Add(button1);
- form1.Controls.Add(button2);
- form1.ShowDialog();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment