static void Main() { using (Mutex mutex = new Mutex(false, "Global\\" + appGuid)) { if (!mutex.WaitOne(0, false)) { FormCustomMessage.ShowError("Instance already running"); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormMain()); } }
public RoadSidewalkForm(int rid) { RoadID = rid; dialogBox = new FormCustomMessage(); dialogBox.Text = "Sidewalks on this Road"; dialogBox.labelMessage.Text = "Does this road have sidewalks?"; sidewalks = new ComboBox(); sidewalks.Items.Add("Yes"); sidewalks.Items.Add("No"); sidewalks.Items.Add("Partial"); sidewalks.Location = new Point(240, 16); dialogBox.groupBoxUser.Controls.Add(sidewalks); Label comment = new Label(); comment.Text = "Comment:"; comment.Location = new Point(12, 40); comment.Size = new Size(80, 24); dialogBox.groupBoxUser.Controls.Add(comment); textBoxComment = new TextBox(); textBoxComment.Size = new Size(240, 24); textBoxComment.Location = new Point(100, 40); dialogBox.groupBoxUser.Controls.Add(textBoxComment); }