public Form2() { InitializeComponent(); hardB = new Button(); promptL = new Label(); easyB = new Button(); medium = new Button(); promptL.Text = "Please select a difficulty"; promptL.AutoSize = true; promptL.Location = new Point(71, 9); medium.Location = new Point(94, 90); medium.Text = "Medium"; medium.Click += medium_Click; easyB.Location = new Point(94, 55); easyB.Text = "Easy"; easyB.Click += easy_Click; hardB.Location = new Point(94, 125); hardB.Text = "Hell"; hardB.Click += hard_Click; this.Controls.Add(easyB); this.Controls.Add(promptL); this.Controls.Add(medium); this.Controls.Add(hardB); easyB.Hide(); medium.Hide(); hardB.Hide(); promptL.Hide(); hardB.Enabled = false; }
protected virtual void ShowButtons() { if (minimized) { return; } if (!currentErrorIsFirstError) { btnLeft.Hide(); btnMiddle.Hide(); btnRight.Hide(); } else if (currentMessage != null) { // left button text if (currentMessage.BtnList.Left == ErrorButton.NoButton) { btnLeft.Hide(); } else { btnLeft.Text = currentMessage.BtnList.Left.ToString(); btnLeft.Show(); } // middle button text if (currentMessage.BtnList.Middle == ErrorButton.NoButton) { btnMiddle.Hide(); } else { btnMiddle.Text = currentMessage.BtnList.Middle.ToString(); btnMiddle.Show(); } // right button text if (currentMessage.BtnList.Right == ErrorButton.NoButton) { btnRight.Hide(); } else { btnRight.Text = currentMessage.BtnList.Right.ToString(); btnRight.Show(); } } }
public void HideCreatePost(Button btn) { if (IsLoggedIn()) { btn.Text = "Create Post"; } else { btn.Hide(); } }
public void SetSizeToBackground() { if (this.BackgroundImage == null) { return; } btnAdvance.PerformClick(); btnAdvance.Hide(); btnCancel.Left = btnAdvance.Left; this.ClientSize = this.BackgroundImage.Size; }
/// <summary> /// Event when submit button is clicked to save players name after winning a level. /// The event sends the information to Parse.com and saves it in gamescore /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> async private void save_name(object sender, EventArgs e) { string name = textbox_leaderboard.Text; ParseObject gameScore = new ParseObject("GameScore"); gameScore["score"] = gamePlay.score; gameScore["playerName"] = name; await gameScore.SaveAsync(); textbox_leaderboard.Hide(); button_leaderboard_name_save.Hide(); get_leaderboard(); }
public TimeToggleButton() { start = (Button)FindControlByName("startTimeButton"); stop = (Button)FindControlByName("stopTimeButton"); start.Click += start_Click; stop.Click += stop_Click; OperateOnControl(stop, _ => { stop.Width = start.Width = (stop.Left + stop.Width) - start.Left; stop.Left = start.Left; stop.Hide(); start.Focus(); }); }
internal void CopperMinerUpgrade(Worker miners, Button copperMinerUpgrade, Label minersLabel) { if (stocks.Wood >= miners.CopperWoodCost && stocks.Stone >= miners.CopperStoneCost && stocks.Copper >= miners.CopperCopperCost) { miners.IsCopper = true; helper.UpdateStocks(miners.CopperWoodCost, "wood"); helper.UpdateStocks(miners.CopperStoneCost, "stone"); helper.UpdateStocks(miners.CopperCopperCost, "copper"); minersLabel.Text = "Copper\nMiners"; copperMinerUpgrade.Hide(); helper.ActionDisplay("buy", "copper miner", true); } }
void cancelarEditar(object sender, EventArgs e) { // Elementos ocultar RBeditar.Show(); RBeliminar.Show(); RBmostrar.Show(); lbContenidoTitulo.Show(); lbContenido.Show(); btnTrabajarPublicaciones.Show(); listaPublicaciones.Show(); //Mostrados txtTituloUpdate.Hide(); btnGuardarEdicion.Hide(); btnCancelar.Hide(); btnAgregar.Hide(); }
/// <summary> /// When the start button is hit, it creates the next page that /// allows the player to choose which game mode they want to play. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void button_start_Click(object sender, EventArgs e) { //On Start click - Hide everything currently active on the form if ((Button)sender == button_start) { button_start.Hide(); button_leaderboard.Hide(); button_howTo.Hide(); } if ((Button)sender == button_return) { panel_results.Hide(); button_return.Hide(); button_continue.Hide(); } gameMain.ActiveForm.BackgroundImage = Mustache_ic___V2.Properties.Resources.moustache_bg; gameMain.ActiveForm.BackgroundImageLayout = ImageLayout.Stretch; //Creates world mode button button_worldsMode = new Button(); button_worldsMode.Text = "Worlds"; button_worldsMode.Size = new Size(250, 390); button_worldsMode.Font = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); button_worldsMode.AutoSize = true; button_worldsMode.Location = new Point(75, 144); button_worldsMode.Anchor = ((System.Windows.Forms.AnchorStyles)(AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top)); button_worldsMode.Click += new System.EventHandler(worldButton_Click); //Bind button click event to worldButton_click function this.Controls.Add(button_worldsMode); //Creates endless mode button button_endlessMode = new Button(); button_endlessMode.Text = "Endless"; button_endlessMode.Size = new Size(250, 390); button_endlessMode.Font = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); button_endlessMode.AutoSize = true; button_endlessMode.Location = new Point(375, 144); button_endlessMode.Anchor = ((AnchorStyles)(AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom)); //Needs event this.Controls.Add(button_endlessMode); }
internal void IronMinerUpgrade(Worker miners, Button ironMinerUpgrade, Label minersLabel) { if (stocks.Wood >= miners.IronWoodCost && stocks.Stone >= miners.IronStoneCost && stocks.Copper >= miners.IronCopperCost && stocks.Iron >= miners.IronIronCost) { miners.IsIron = true; helper.UpdateStocks(miners.IronWoodCost, "wood"); helper.UpdateStocks(miners.IronStoneCost, "stone"); helper.UpdateStocks(miners.IronCopperCost, "copper"); helper.UpdateStocks(miners.IronIronCost, "iron"); minersLabel.Text = "Iron\nMiners"; ironMinerUpgrade.Hide(); helper.ActionDisplay("buy", "iron miner", true); } }
public DefaultErrorPanel(IErrorMessage message) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this.message = message; textBox1.Text = (message.FullDescription != null) ? message.FullDescription : message.Text; // left button text if (message.BtnList.Left == ErrorButton.NoButton) { btnLeft.Hide(); } else { btnLeft.Text = message.BtnList.Left.ToString(); } // middle button text if (message.BtnList.Middle == ErrorButton.NoButton) { btnMiddle.Hide(); } else { btnMiddle.Text = message.BtnList.Middle.ToString(); } // right button text if (message.BtnList.Right == ErrorButton.NoButton) { btnRight.Hide(); } else { btnRight.Text = message.BtnList.Right.ToString(); } }
public ColorDialog () : base() { form = new DialogForm (this); form.SuspendLayout (); form.Text = "Color"; form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; satTextBox = new TextBox (); briTextBox = new TextBox (); blueTextBox = new TextBox (); greenTextBox = new TextBox (); redTextBox = new TextBox (); hueTextBox = new TextBox (); redLabel = new Label (); blueLabel = new Label (); greenLabel = new Label (); colorBaseLabel = new Label (); hueLabel = new Label (); satLabel = new Label (); briLabel = new Label (); okButton = new Button (); cancelButton = new Button (); form.CancelButton = cancelButton; helpButton = new Button (); defineColoursButton = new Button (); addColoursButton = new Button (); baseColorControl = new BaseColorControl (this); colorMatrixControl = new ColorMatrixControl (this); brightnessControl = new BrightnessControl (this); triangleControl = new TriangleControl (this); selectedColorPanel = new Panel (); // hueTextBox hueTextBox.Location = new Point (324, 203); hueTextBox.Size = new Size (27, 21); hueTextBox.TabIndex = 11; hueTextBox.MaxLength = 3; // satTextBox satTextBox.Location = new Point (324, 225); satTextBox.Size = new Size (27, 21); satTextBox.TabIndex = 15; satTextBox.MaxLength = 3; // greenTextBox greenTextBox.Location = new Point (404, 225); greenTextBox.Size = new Size (27, 21); greenTextBox.TabIndex = 18; greenTextBox.MaxLength = 3; // briTextBox briTextBox.Location = new Point (324, 247); briTextBox.Size = new Size (27, 21); briTextBox.TabIndex = 16; briTextBox.MaxLength = 3; // blueTextBox blueTextBox.Location = new Point (404, 247); blueTextBox.Size = new Size (27, 21); blueTextBox.TabIndex = 19; blueTextBox.MaxLength = 3; // redTextBox redTextBox.Location = new Point (404, 203); redTextBox.Size = new Size (27, 21); redTextBox.TabIndex = 17; redTextBox.MaxLength = 3; // redLabel redLabel.FlatStyle = FlatStyle.System; redLabel.Location = new Point (361, 206); redLabel.Size = new Size (40, 16); redLabel.TabIndex = 25; redLabel.Text = Locale.GetText ("Red") + ":"; redLabel.TextAlign = ContentAlignment.MiddleRight; // blueLabel blueLabel.FlatStyle = FlatStyle.System; blueLabel.Location = new Point (361, 250); blueLabel.Size = new Size (40, 16); blueLabel.TabIndex = 26; blueLabel.Text = Locale.GetText ("Blue") + ":"; blueLabel.TextAlign = ContentAlignment.MiddleRight; // greenLabel greenLabel.FlatStyle = FlatStyle.System; greenLabel.Location = new Point (361, 228); greenLabel.Size = new Size (40, 16); greenLabel.TabIndex = 27; greenLabel.Text = Locale.GetText ("Green") + ":"; greenLabel.TextAlign = ContentAlignment.MiddleRight; // colorBaseLabel colorBaseLabel.Location = new Point (228, 247); colorBaseLabel.Size = new Size (60, 25); colorBaseLabel.TabIndex = 28; colorBaseLabel.Text = Locale.GetText ("Color"); colorBaseLabel.TextAlign = ContentAlignment.MiddleCenter; // hueLabel hueLabel.FlatStyle = FlatStyle.System; hueLabel.Location = new Point (287, 206); hueLabel.Size = new Size (36, 16); hueLabel.TabIndex = 23; hueLabel.Text = Locale.GetText ("Hue") + ":"; hueLabel.TextAlign = ContentAlignment.MiddleRight; // satLabel satLabel.FlatStyle = FlatStyle.System; satLabel.Location = new Point (287, 228); satLabel.Size = new Size (36, 16); satLabel.TabIndex = 22; satLabel.Text = Locale.GetText ("Sat") + ":"; satLabel.TextAlign = ContentAlignment.MiddleRight; // briLabel briLabel.FlatStyle = FlatStyle.System; briLabel.Location = new Point (287, 250); briLabel.Size = new Size (36, 16); briLabel.TabIndex = 24; briLabel.Text = Locale.GetText ("Bri") + ":"; briLabel.TextAlign = ContentAlignment.MiddleRight; // defineColoursButton defineColoursButton.FlatStyle = FlatStyle.System; defineColoursButton.Location = new Point (5, 244); defineColoursButton.Size = new Size (210, 22); defineColoursButton.TabIndex = 6; // FIXME: update resource files defineColoursButton.Text = "Define Custom Colors >>"; //defineColoursButton.Text = Locale.GetText ("Define Custom Colors >>"); // okButton okButton.FlatStyle = FlatStyle.System; okButton.Location = new Point (5, 271); okButton.Size = new Size (66, 22); okButton.TabIndex = 0; okButton.Text = Locale.GetText ("OK"); // cancelButton cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point (78, 271); cancelButton.Size = new Size (66, 22); cancelButton.TabIndex = 1; cancelButton.Text = Locale.GetText ("Cancel"); // helpButton helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point (149, 271); helpButton.Size = new Size (66, 22); helpButton.TabIndex = 5; helpButton.Text = Locale.GetText ("Help"); helpButton.Hide (); // addColoursButton addColoursButton.FlatStyle = FlatStyle.System; addColoursButton.Location = new Point (227, 271); addColoursButton.Size = new Size (213, 22); addColoursButton.TabIndex = 7; // FIXME: update resource files addColoursButton.Text = "Add To Custom Colors"; //addColoursButton.Text = Locale.GetText ("Add To Custom Colors"); // baseColorControl baseColorControl.Location = new Point (3, 6); baseColorControl.Size = new Size (212, 231); baseColorControl.TabIndex = 13; // colorMatrixControl colorMatrixControl.Location = new Point (227, 7); colorMatrixControl.Size = new Size (179, 190); colorMatrixControl.TabIndex = 14; // triangleControl triangleControl.Location = new Point (432, 0); triangleControl.Size = new Size (16, 204); triangleControl.TabIndex = 12; // brightnessControl brightnessControl.Location = new Point (415, 7); brightnessControl.Size = new Size (14, 190); brightnessControl.TabIndex = 20; // selectedColorPanel selectedColorPanel.BackColor = SystemColors.Desktop; selectedColorPanel.BorderStyle = BorderStyle.Fixed3D; selectedColorPanel.Location = new Point (227, 202); selectedColorPanel.Size = new Size (60, 42); selectedColorPanel.TabIndex = 10; form.Controls.Add (hueTextBox); form.Controls.Add (satTextBox); form.Controls.Add (briTextBox); form.Controls.Add (redTextBox); form.Controls.Add (greenTextBox); form.Controls.Add (blueTextBox); form.Controls.Add (defineColoursButton); form.Controls.Add (okButton); form.Controls.Add (cancelButton); form.Controls.Add (addColoursButton); form.Controls.Add (helpButton); form.Controls.Add (baseColorControl); form.Controls.Add (colorMatrixControl); form.Controls.Add (brightnessControl); form.Controls.Add (triangleControl); form.Controls.Add (colorBaseLabel); form.Controls.Add (greenLabel); form.Controls.Add (blueLabel); form.Controls.Add (redLabel); form.Controls.Add (briLabel); form.Controls.Add (hueLabel); form.Controls.Add (satLabel); form.Controls.Add (selectedColorPanel); form.ResumeLayout (false); Color = Color.Black; defineColoursButton.Click += new EventHandler (OnClickButtonDefineColours); addColoursButton.Click += new EventHandler (OnClickButtonAddColours); helpButton.Click += new EventHandler (OnClickHelpButton); cancelButton.Click += new EventHandler (OnClickCancelButton); okButton.Click += new EventHandler (OnClickOkButton); hueTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); satTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); briTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); redTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); greenTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); blueTextBox.KeyPress += new KeyPressEventHandler (OnKeyPressTextBoxes); hueTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); satTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); briTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); redTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); greenTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); blueTextBox.TextChanged += new EventHandler (OnTextChangedTextBoxes); hueTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); satTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); briTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); redTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); greenTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); blueTextBox.GotFocus += new EventHandler (OnGotFocusTextBoxes); hueTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); satTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); briTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); redTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); greenTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); blueTextBox.LostFocus += new EventHandler (OnLostFocusTextBoxes); ResetCustomColors (); }
private void AddExistingNoteTab(DateTime date, String noteTitle, String noteContent, String providerName, String noteheader) { TabPage newTab = new TabPage(); Button newSignButton = new System.Windows.Forms.Button(); Label newDateValueLabel = new System.Windows.Forms.Label(); RichTextBox newAddendumBox = new System.Windows.Forms.RichTextBox(); Label newTitleValueNameLabel = new System.Windows.Forms.Label(); Button newAddendumButton = new System.Windows.Forms.Button(); Label newNoteLabel = new System.Windows.Forms.Label(); RichTextBox newNoteBox = new System.Windows.Forms.RichTextBox(); Label newDateLabel = new System.Windows.Forms.Label(); Label newNoteTitleLabel = new System.Windows.Forms.Label(); Label newAddendumLabel = new System.Windows.Forms.Label(); Button newExitButton = new System.Windows.Forms.Button(); // SignButton1 // newSignButton.BackColor = System.Drawing.SystemColors.ActiveCaption; newSignButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; newSignButton.FlatAppearance.BorderSize = 0; newSignButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; newSignButton.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newSignButton.Location = new System.Drawing.Point(437, 49); newSignButton.Name = "newSignButton"; newSignButton.Size = new System.Drawing.Size(94, 26); newSignButton.TabIndex = 66; newSignButton.Text = "Sign"; newSignButton.UseVisualStyleBackColor = false; newSignButton.Hide(); newSignButton.Click += new System.EventHandler(ExistingSignButtonClick); // // DateValueLabel1 // newDateValueLabel.AutoSize = true; newDateValueLabel.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newDateValueLabel.Location = new System.Drawing.Point(101, 12); newDateValueLabel.Name = "newDateValueLabel"; newDateValueLabel.Size = new System.Drawing.Size(82, 17); newDateValueLabel.TabIndex = 57; newDateValueLabel.Text = date.ToShortDateString(); newDateValueLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; // // AddendumBox1 // newAddendumBox.Font = new System.Drawing.Font("Bahnschrift Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); newAddendumBox.Location = new System.Drawing.Point(7, 314); newAddendumBox.Multiline = true; newAddendumBox.Name = "newAddendumBox"; newAddendumBox.Size = new System.Drawing.Size(650, 254); newAddendumBox.TabIndex = 56; newAddendumBox.TextChanged += new System.EventHandler(this.AddendumBox_TextChanged); newAddendumBox.ScrollBars = RichTextBoxScrollBars.Vertical; newAddendumBox.BorderStyle = BorderStyle.FixedSingle; newAddendumBox.Hide(); // // TitleNameLabel // newTitleValueNameLabel.AutoSize = true; newTitleValueNameLabel.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newTitleValueNameLabel.Location = new System.Drawing.Point(101, 38); newTitleValueNameLabel.Name = "newTitleValueNameLabel"; newTitleValueNameLabel.Size = new System.Drawing.Size(36, 17); newTitleValueNameLabel.TabIndex = 53; newTitleValueNameLabel.Text = noteTitle; newTitleValueNameLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; // // AddendumButton // newAddendumButton.BackColor = System.Drawing.SystemColors.ActiveCaption; newAddendumButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; newAddendumButton.FlatAppearance.BorderSize = 0; newAddendumButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; newAddendumButton.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newAddendumButton.Location = new System.Drawing.Point(437, 49); newAddendumButton.Name = "newAddendumButton"; newAddendumButton.Size = new System.Drawing.Size(94, 26); newAddendumButton.TabIndex = 52; newAddendumButton.Text = "Addendum"; newAddendumButton.UseVisualStyleBackColor = false; newAddendumButton.Click += new System.EventHandler(AddendumButtonClick); newAddendumButton.Show(); // // NoteLabel1 // newNoteLabel.AutoSize = true; newNoteLabel.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newNoteLabel.Location = new System.Drawing.Point(26, 64); newNoteLabel.Name = "newNoteLabel"; newNoteLabel.Size = new System.Drawing.Size(42, 17); newNoteLabel.TabIndex = 51; newNoteLabel.Text = "Note:"; newNoteLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; // // NoteBox1 // newNoteBox.Font = new System.Drawing.Font("Bahnschrift Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); newNoteBox.Location = new System.Drawing.Point(6, 100); newNoteBox.Multiline = true; newNoteBox.Name = "newNoteBox"; if (noteContent.Contains("wrote on: ")) { newNoteBox.Text = noteContent; } else { newNoteBox.Text = noteheader + "\n" + noteContent.Replace(noteheader, "") + "\n"; } newNoteBox.Size = new System.Drawing.Size(738, 623); newNoteBox.TabIndex = 50; newNoteBox.ScrollBars = RichTextBoxScrollBars.Vertical; newNoteBox.BorderStyle = BorderStyle.FixedSingle; // // // DateLabel1 // newDateLabel.AutoSize = true; newDateLabel.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newDateLabel.Location = new System.Drawing.Point(26, 12); newDateLabel.Name = "newDateLabel"; newDateLabel.Size = new System.Drawing.Size(40, 17); newDateLabel.TabIndex = 47; newDateLabel.Text = "Date: "; newDateLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; // // NoteTitleLabel1 // newNoteTitleLabel.AutoSize = true; newNoteTitleLabel.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newNoteTitleLabel.Location = new System.Drawing.Point(26, 38); newNoteTitleLabel.Name = "newNoteTitleLabel"; newNoteTitleLabel.Size = new System.Drawing.Size(72, 17); newNoteTitleLabel.TabIndex = 46; newNoteTitleLabel.Text = "Note Title: "; newNoteTitleLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; // newAddendumLabel // newAddendumLabel.AutoSize = true; newAddendumLabel.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newAddendumLabel.Location = new System.Drawing.Point(24, 293); newAddendumLabel.Name = "newAddendumLabel"; newAddendumLabel.Size = new System.Drawing.Size(77, 17); newAddendumLabel.TabIndex = 67; newAddendumLabel.Text = "Addendum: "; newAddendumLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight; newAddendumLabel.Hide(); //newExitButton newExitButton.BackColor = System.Drawing.SystemColors.ActiveCaption; newExitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; newExitButton.FlatAppearance.BorderSize = 0; newExitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; newExitButton.Font = new System.Drawing.Font("Bahnschrift Light", 10F); newExitButton.Location = new System.Drawing.Point(550, 49); newExitButton.Name = "ExitButton"; newExitButton.Size = new System.Drawing.Size(94, 26); newExitButton.TabIndex = 52; newExitButton.Text = "Exit"; newExitButton.UseVisualStyleBackColor = false; newExitButton.Click += new System.EventHandler(ExitButtonClick); newTab.Controls.Add(newExitButton); newTab.Controls.Add(newSignButton); newTab.Controls.Add(newDateValueLabel); newTab.Controls.Add(newAddendumBox); newTab.Controls.Add(newTitleValueNameLabel); newTab.Controls.Add(newAddendumButton); newTab.Controls.Add(newNoteLabel); newTab.Controls.Add(newNoteBox); newTab.Controls.Add(newDateLabel); newTab.Controls.Add(newNoteTitleLabel); newTab.Controls.Add(newAddendumLabel); newTab.Location = new System.Drawing.Point(4, 22); newTab.Padding = new System.Windows.Forms.Padding(3); newTab.Size = new System.Drawing.Size(669, 584); newTab.TabIndex = NewNoteTabControl.TabCount; newTab.Text = noteTitle; newTab.UseVisualStyleBackColor = true; NewNoteTabControl.TabPages.Add(newTab); NewNoteTabControl.SelectedTab = newTab; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button2 = new System.Windows.Forms.Button(); this.listBox1 = new System.Windows.Forms.ListBox(); this.button3 = new System.Windows.Forms.Button(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.button4 = new System.Windows.Forms.Button(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.button5 = new System.Windows.Forms.Button(); this.printDialog1 = new System.Windows.Forms.PrintDialog(); this.button6 = new System.Windows.Forms.Button(); this.printDocument1 = new System.Drawing.Printing.PrintDocument(); button7 = new System.Windows.Forms.Button(); label1 = new System.Windows.Forms.Label(); button8 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(130, 203); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 21); this.button1.TabIndex = 0; this.button1.Text = "Add"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(12, 203); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(112, 20); this.textBox1.TabIndex = 2; this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_Enter); // // button2 // this.button2.Location = new System.Drawing.Point(130, 11); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 21); this.button2.TabIndex = 3; this.button2.Text = "Delete"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // listBox1 // this.listBox1.FormattingEnabled = true; this.listBox1.Location = new System.Drawing.Point(12, 11); this.listBox1.Name = "listBox1"; this.listBox1.Size = new System.Drawing.Size(112, 186); this.listBox1.TabIndex = 4; // // button3 // this.button3.Location = new System.Drawing.Point(130, 38); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 21); this.button3.TabIndex = 5; this.button3.Text = "Clear List"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // saveFileDialog1 // this.saveFileDialog1.DefaultExt = "txt"; this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk); // // button4 // this.button4.Location = new System.Drawing.Point(130, 92); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(75, 21); this.button4.TabIndex = 6; this.button4.Text = "Save List"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // openFileDialog1 // this.openFileDialog1.DefaultExt = "txt"; this.openFileDialog1.FileName = "openFileDialog1"; // // button5 // this.button5.Location = new System.Drawing.Point(130, 65); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 21); this.button5.TabIndex = 7; this.button5.Text = "Open List"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // printDialog1 // this.printDialog1.UseEXDialog = true; // // button6 // this.button6.Location = new System.Drawing.Point(130, 119); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(75, 21); this.button6.TabIndex = 8; this.button6.Text = "Print List"; this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // // button7 // button7.Location = new System.Drawing.Point(130, 175); button7.Name = "button7"; button7.Size = new System.Drawing.Size(75, 21); button7.TabIndex = 9; button7.Text = "Login"; button7.UseVisualStyleBackColor = true; button7.Click += new System.EventHandler(this.button7_Click); // // label1 // label1.AutoSize = true; label1.Location = new System.Drawing.Point(64, 226); label1.Name = "label1"; label1.Size = new System.Drawing.Size(79, 13); label1.TabIndex = 10; label1.Text = "Working locally"; // // button8 // button8.Location = new System.Drawing.Point(131, 146); button8.Name = "button8"; button8.Size = new System.Drawing.Size(75, 23); button8.TabIndex = 11; button8.Text = "Log out"; button8.UseVisualStyleBackColor = true; button8.Hide(); button8.Click += new System.EventHandler(this.button8_Click); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(210, 242); this.Controls.Add(button8); this.Controls.Add(label1); this.Controls.Add(button7); this.Controls.Add(this.button6); this.Controls.Add(this.button5); this.Controls.Add(this.button4); this.Controls.Add(this.button3); this.Controls.Add(this.listBox1); this.Controls.Add(this.button2); this.Controls.Add(this.textBox1); this.Controls.Add(this.button1); this.Name = "MainForm"; this.Text = "List It"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); this.PerformLayout(); }
protected void RemoveZoom(ref Button btn) { if (btn != null) { btn.Hide(); btn.Dispose(); btn = null; // reset zoom window } }
void TrabajarConEncuesta(object sender, EventArgs e) { if (RBeditar.Checked == false && RBeliminar.Checked == false && RBmostrar.Checked == false) { MessageBox.Show("Debe seleccionar una opcion"); } else { if (listaPublicaciones.SelectedRows.Count > 0 && RBeliminar.Checked == true) { int filaSeleccionada = listaPublicaciones.CurrentRow.Index; usuarioNL usuarioNL = new usuarioNL(); usuarioNL.borrarPublicacion(valor); listaPublicaciones.Columns.Clear(); listaPublicaciones.DataSource = ""; CargarEncuesta(); MessageBox.Show("Eliminar!!!"); } else if (listaPublicaciones.SelectedRows.Count > 0 && RBeditar.Checked == true) { int filaSeleccionada = listaPublicaciones.CurrentRow.Index; usuarioNL nl = new usuarioNL(); // Elementos ocultar RBeditar.Hide(); RBeliminar.Hide(); RBmostrar.Hide(); lbContenidoTitulo.Hide(); lbContenido.Hide(); btnTrabajarPublicaciones.Hide(); listaPublicaciones.Hide(); btnAgregar.Hide(); //Mostrados txtTituloUpdate.Show(); txtTituloUpdate.Text = nl.CargarDataPublicacion(valor).titulo.ToString(); txtContenido.ReadOnly = false; btnGuardarEdicion.Show(); btnCancelar.Show(); } else if (listaPublicaciones.SelectedRows.Count > 0 && RBmostrar.Checked == true) { int filaSeleccionada = listaPublicaciones.CurrentRow.Index; usuarioNL nl = new usuarioNL(); lbContenidoFecha.Text = ""; lbContenidoFecha.Text = nl.CargarDataPublicacion(valor).fecha.ToString(); lbContenidoFecha.Visible = true; lbContenidoTitulo.Text = ""; lbContenidoTitulo.Text = nl.CargarDataPublicacion(valor).titulo.ToString(); lbContenidoTitulo.Visible = true; txtContenido.Text = ""; txtContenido.Text = nl.CargarDataPublicacion(valor).contenido.ToString(); RBeditar.Visible = true; } else { MessageBox.Show("Debe seleccionar la columna pulsando en la columna a la izquierda del todo"); } } }
/// <summary> /// Shows the player's score, whether they win/lose, and the top 10 on the leaderboard for the current level. /// </summary> /// <param name="sender">Reference to method that calls this event</param> /// <param name="e"></param> public void results(object sender, EventArgs e) { game.hideGameControls(); int x = gameMain.ActiveForm.Width; int x_textbox = 0; int x_button = 0; int x_win = 0; //Creates a panel for results of the game to show panel_results = new Panel(); panel_results.Dock = System.Windows.Forms.DockStyle.Fill; panel_results.Location = new System.Drawing.Point(0, 0); panel_results.Size = new System.Drawing.Size(gameMain.ActiveForm.Width, gameMain.ActiveForm.Height);//THROWS ERROR EXCEPTION panel_results.Visible = true; panel_results.BackColor = Color.AntiqueWhite; //Creates a label for player's final score label_score = new Label(); label_score.AutoSize = true; label_score.BackColor = System.Drawing.Color.Transparent; label_score.Text = "Score: " + gamePlay.score.ToString(); label_score.Font = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); label_score.Location = new System.Drawing.Point(0, 0);//66, 114 label_score.Name = "label_score"; label_score.Visible = true; //Indicates whether the player reached the needed score to move on label_win_lose = new Label(); label_win_lose.AutoSize = true; label_win_lose.BackColor = System.Drawing.Color.Transparent; label_win_lose.Font = new System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); label_win_lose.ForeColor = System.Drawing.Color.Red; //x_win = ((x/2) - (label_win_lose.Width/2)); label_win_lose.Location = new System.Drawing.Point(212, 100); label_win_lose.Name = "label_win_lose"; this.label_win_lose.Size = new System.Drawing.Size(286, 86); //Creates a button for the player to return the game modes page button_return = new Button(); button_return.AutoSize = true; button_return.Size = new System.Drawing.Size(100, 50); //200, 100 button_return.Location = new Point(100, 650); //100, 400 button_return.Text = "Return"; button_return.Font = new System.Drawing.Font("Comic Sans MS", 26F, FontStyle.Bold); button_return.Click += new EventHandler(button_start_Click); //Creates a button for the player to move onto the next levels button_continue = new Button(); button_continue.AutoSize = true; button_continue.Size = new System.Drawing.Size(100, 50); //200, 100 button_continue.Location = new Point(400, 650); //400, 400 button_continue.Text = "Continue"; button_continue.Font = new System.Drawing.Font("Comic Sans MS", 26F, FontStyle.Bold); //Creates TextBox for leadboard name entry textbox_leaderboard = new TextBox(); //x_textbox = (x - textbox_leaderboard.Width) / 2; textbox_leaderboard.Name = "textbox_leaderboard"; textbox_leaderboard.Size = new System.Drawing.Size(350, 150); textbox_leaderboard.TabIndex = 0; textbox_leaderboard.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F); textbox_leaderboard.Location = new System.Drawing.Point(180, 400); // this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); //Creates a button to save name for leaderboard button_leaderboard_name_save = new Button(); button_leaderboard_name_save.AutoSize = true; //x_button = (x - button_leaderboard_name_save.Width) / 2; button_leaderboard_name_save.Size = new System.Drawing.Size(100, 50); button_leaderboard_name_save.Text = "Submit"; button_leaderboard_name_save.Font = new System.Drawing.Font("Comic Sans MS", 26F, FontStyle.Bold); button_leaderboard_name_save.Location = new Point(305, 450); button_leaderboard_name_save.Click += new EventHandler(save_name); //Creates a listBox for the top 5 leaderboard listBox_leaderboard = new ListBox(); listBox_leaderboard.FormattingEnabled = true; listBox_leaderboard.Location = new System.Drawing.Point(251, 200); listBox_leaderboard.Name = "listBox_leaderboard"; listBox_leaderboard.Size = new System.Drawing.Size(200, 200); listBox_leaderboard.TabIndex = 0; listBox_leaderboard.Font = new System.Drawing.Font("Comic Sans MS", 16F, FontStyle.Bold); //Add all created controls to panel panel_results.Controls.Add(button_return); panel_results.Controls.Add(button_continue); panel_results.Controls.Add(label_score); panel_results.Controls.Add(label_win_lose); panel_results.Controls.Add(button_leaderboard_name_save); panel_results.Controls.Add(textbox_leaderboard); panel_results.Controls.Add(listBox_leaderboard); //Add Panel to form this.Controls.Add(panel_results); label_win_lose.Show(); label_score.Show(); this.panel_results.BringToFront(); //Depending on the player's score, it will say either they won or lost int passingScore = 1000; if (gamePlay.score >= passingScore) { label_win_lose.Text = "You Win!"; //System.Media.SoundPlayer player = new System.Media.SoundPlayer(global::Mustache_ic___V2.Properties.Resources.WINNER); //player.Play(); listBox_leaderboard.Hide(); button_leaderboard_name_save.Show(); textbox_leaderboard.Show(); } else { label_win_lose.Text = "You Lose!"; button_leaderboard_name_save.Hide(); textbox_leaderboard.Hide(); //listBox_leaderboard.Hide(); //System.Media.SoundPlayer player = new System.Media.SoundPlayer(global::Mustache_ic___V2.Properties.Resources.Price_Is_Right_loser_clip); //player.Play(); get_leaderboard(); } }
public mainWindow(Intersection modelIntersection, SimulationEnvironment simulation) { InitializeComponent(); this.simulation = simulation; this.model = modelIntersection; //Main Menus mainMenu = new MainMenu(); this.Menu = mainMenu; //File Menu myMenuItemFile = new MenuItem("&File"); simRunMenuItem = new MenuItem("&Run/Stop Simulation"); saveFileMenuItem = new MenuItem("&Save File"); openFileMenuItem = new MenuItem("&Open File"); saveMySQLMenuItem = new MenuItem("&Save MySQL"); openMySQLMenuItem = new MenuItem("&Open MySQL"); exitMenuItem = new MenuItem("&Exit"); mainMenu.MenuItems.Add(myMenuItemFile); myMenuItemFile.MenuItems.Add(simRunMenuItem); myMenuItemFile.MenuItems.Add(saveFileMenuItem); myMenuItemFile.MenuItems.Add(openFileMenuItem); myMenuItemFile.MenuItems.Add(saveMySQLMenuItem); myMenuItemFile.MenuItems.Add(openMySQLMenuItem); myMenuItemFile.MenuItems.Add(exitMenuItem); //Settings Menu myMenuItemSettings = new MenuItem("&Settings"); setHLanesMenuItem = new MenuItem("&Set No. Horizontal Lanes"); setVLanesMenuItem = new MenuItem("&Set No. Vertical Lanes"); setHProbMenuItem = new MenuItem("&Set Horizontal Lane Car Regularity"); setVProbMenuItem = new MenuItem("&Set Vertical Lane Car Regularity"); setHSpeedMenuItem = new MenuItem("&Set Road Speed Horizontal"); setVSpeedMenuItem = new MenuItem("&Set Road Speed Vertical"); setTurnRightMenuItem = new MenuItem("&Set Turning Probability Right"); setTurnLeftMenuItem = new MenuItem("&Set Turning Probability Left"); setBreakdownMenuItem = new MenuItem("&Set Breakdown Probability"); setLightCycleMenuItem = new MenuItem("&Set Light Cycle Times"); setRHD = new MenuItem("&Set RHD"); setLHD = new MenuItem("&Set LHD"); mainMenu.MenuItems.Add(myMenuItemSettings); myMenuItemSettings.MenuItems.Add(setRHD); myMenuItemSettings.MenuItems.Add(setLHD); myMenuItemSettings.MenuItems.Add(setHLanesMenuItem); myMenuItemSettings.MenuItems.Add(setVLanesMenuItem); myMenuItemSettings.MenuItems.Add(setHProbMenuItem); myMenuItemSettings.MenuItems.Add(setVProbMenuItem); myMenuItemSettings.MenuItems.Add(setVSpeedMenuItem); myMenuItemSettings.MenuItems.Add(setHSpeedMenuItem); myMenuItemSettings.MenuItems.Add(setTurnRightMenuItem); myMenuItemSettings.MenuItems.Add(setTurnLeftMenuItem); myMenuItemSettings.MenuItems.Add(setBreakdownMenuItem); myMenuItemSettings.MenuItems.Add(setLightCycleMenuItem); setLHD.Visible = false; //Control Buttons runSimulationButton = new Button(); runSimulationButton.Text = "Run"; runSimulationButton.BackColor = Color.White; stopSimulationButton = new Button(); stopSimulationButton.Text = "Pause"; stopSimulationButton.BackColor = Color.White; resetSimulationButton = new Button(); resetSimulationButton.Text = "Reset"; resetSimulationButton.BackColor = Color.White; runSimulationButton.Location = new Point(200, 530); stopSimulationButton.Location = new Point(200, 530); resetSimulationButton.Location = new Point(450, 530); stopSimulationButton.Hide(); resetSimulationButton.Hide(); Controls.Add(runSimulationButton); Controls.Add(stopSimulationButton); Controls.Add(resetSimulationButton); //Event Handlers saveFileMenuItem.Click += new System.EventHandler(OnClickSave); openFileMenuItem.Click += new System.EventHandler(OnClickOpen); saveMySQLMenuItem.Click += new System.EventHandler(OnClickSaveDB); openMySQLMenuItem.Click += new System.EventHandler(OnClickOpenDB); setRHD.Click +=new EventHandler(OnClickSetRHD); setLHD.Click +=new EventHandler(OnClickSetLHD); exitMenuItem.Click += new System.EventHandler(OnClickExit); setHLanesMenuItem.Click += new System.EventHandler(OnClickHLanes); setVLanesMenuItem.Click += new System.EventHandler(OnClickVLanes); simRunMenuItem.Click += new System.EventHandler(simulationToggle); runSimulationButton.Click += new System.EventHandler(simulationToggle); stopSimulationButton.Click += new System.EventHandler(simulationToggle); resetSimulationButton.Click += new EventHandler(resetSimulation); setHProbMenuItem.Click += new EventHandler(settingsHProbListener); setVProbMenuItem.Click += new EventHandler(settingsVProbListener); setHSpeedMenuItem.Click += new EventHandler(setHSpeedMenuItem_Click); setVSpeedMenuItem.Click += new EventHandler(setVSpeedMenuItem_Click); setTurnRightMenuItem.Click += new EventHandler(setTurnRightMenuItem_Click); setTurnLeftMenuItem.Click += new EventHandler(setTurnLeftMenuItem_Click); setBreakdownMenuItem.Click += new EventHandler(setBreakdownMenuItem_Click); setLightCycleMenuItem.Click += new EventHandler(setLightCycleMenuItem_Click); }
internal void PurchaseStocksUpgrade(Button stocksUpgrade, Label stocksLevel, Label rationsLabel) { // Do we have the funds? if (stocks.Wood >= stocks.WoodUpgradeCost && stocks.Stone >= stocks.StoneUpgradeCost && stocks.Copper >= stocks.CopperUpgradeCost && stocks.Iron >= stocks.IronUpgradeCost) { // Update the stock cap, and the stock upgrade text stocks.StockCap *= 2; stocks.RationsCap *= 2; stocksLevel.Text = helper.StockUpgradeTitle(stocks.UpgradeLevel) + "(Cap-" + stocks.StockCap + ")"; rationsLabel.Text = "/" + stocks.RationsCap; // Subtract the nessessary funds helper.UpdateStocks(stocks.WoodUpgradeCost, "wood"); helper.UpdateStocks(stocks.StoneUpgradeCost, "stone"); helper.UpdateStocks(stocks.CopperUpgradeCost, "copper"); helper.UpdateStocks(stocks.IronUpgradeCost, "iron"); // Update the cost for the next purchase stocks.WoodUpgradeCost = helper.RoundIt(stocks.WoodUpgradeCost, "*", 2f); stocks.StoneUpgradeCost = helper.RoundIt(stocks.StoneUpgradeCost, "*", 2f); stocks.CopperUpgradeCost = helper.RoundIt(stocks.CopperUpgradeCost, "*", 2f); stocks.IronUpgradeCost = helper.RoundIt(stocks.IronUpgradeCost, "*", 2f); // Update the button text stocksUpgrade.Text = "Stocks Upgrade\nWood-" + stocks.WoodUpgradeCost + " Stone-" + stocks.StoneUpgradeCost + " Copper-" + stocks.CopperUpgradeCost + " Iron-" + stocks.IronUpgradeCost; if (stocks.UpgradeLevel == 3) { stocksUpgrade.Hide(); } stocks.UpgradeLevel++; helper.ActionDisplay("buy", "stocks", true); } }
public Multiplayer() { this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.multiplayer_FormClosing); if (Properties.Settings.Default.WindowMax) { WindowState = FormWindowState.Maximized; } if (Properties.Settings.Default.WindowLocation != null) { this.Location = Properties.Settings.Default.WindowLocation; } if (Properties.Settings.Default.WindowSize != null) { this.Size = Properties.Settings.Default.WindowSize; } this.BackgroundImage = new Bitmap(@"data\img\Texture.png"); Bitmap color = new Bitmap(@"data\img\Colors.png"); System.Drawing.Color color_blue = color.GetPixel(1, 1); mapListMenu = new MapList(); buttonClickSnd = new WindowsMediaPlayer(); buttonClickSnd.URL = @"data/snd/misc/thunk.wav"; this.Resize += new EventHandler(multiplayer_Resize); this.title = new Label(); title.Location = new Point(this.Width / 3 - buttonX / 48, this.Height / 16); title.Text = "Multi Player Game Options"; title.AutoSize = true; title.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); title.BackColor = Color.Transparent; title.ForeColor = Color.White; this.Controls.Add(title); this.host = new Button(); host.Location = new Point(this.Width / 2 - buttonX / 2, this.Height / 4); host.Height = buttonY; host.Width = buttonX; host.BackColor = color_blue; host.ForeColor = Color.Gold; host.Text = "Host Multi Player Game"; host.Click += new EventHandler(mapSelect_Click); this.Controls.Add(host); this.join = new Button(); join.Location = new Point(this.Width / 2 - buttonX / 2, this.Height / 8 * 3); join.Height = buttonY; join.Width = buttonX; join.BackColor = color_blue; join.ForeColor = Color.Gold; join.Text = "Join Multiplayer Game"; join.Click += new EventHandler(join_Click); this.Controls.Add(join); this.joinDirect = new Button(); joinDirect.Location = new Point(this.Width / 2 - buttonX / 2, this.Height / 4); joinDirect.Height = buttonY; joinDirect.Width = buttonX; joinDirect.BackColor = color_blue; joinDirect.ForeColor = Color.Gold; joinDirect.Text = "Direct Connection"; //joinDirect.Click += new EventHandler(back_Click); joinDirect.Hide(); // Hide the join buttons at initialization this.Controls.Add(joinDirect); this.joinServer = new Button(); joinServer.Location = new Point(this.Width / 2 - buttonX / 2, this.Height / 8 * 3); joinServer.Height = buttonY; joinServer.Width = buttonX; joinServer.BackColor = color_blue; joinServer.ForeColor = Color.Gold; joinServer.Text = "Server Connection"; joinServer.Click += new EventHandler(joinServer_Click); joinServer.Hide(); // Hide the join buttons at initialization this.Controls.Add(joinServer); initServerTable(); this.back = new Button(); back.Location = new Point(this.Width / 2 - buttonX / 2, this.Height / 8 * 5); back.Height = buttonY; back.Width = buttonX; back.BackColor = color_blue; back.ForeColor = Color.Gold; back.Text = "Back"; back.Click += new EventHandler(back_Click); this.Controls.Add(back); }
private void EsconderButton(Button btn) { btn.Hide(); }
public FontDialog( ) { form = new DialogForm (this); example_panel_text = char_sets [0]; okButton = new Button( ); cancelButton = new Button( ); applyButton = new Button( ); helpButton = new Button( ); fontTextBox = new TextBox( ); fontstyleTextBox = new TextBox( ); fontsizeTextBox = new TextBox( ); fontListBox = new MouseWheelListBox (); fontsizeListBox = new MouseWheelListBox (); fontstyleListBox = new MouseWheelListBox (); fontLabel = new Label( ); fontstyleLabel = new Label( ); sizeLabel = new Label( ); scriptLabel = new Label( ); exampleGroupBox = new GroupBox( ); effectsGroupBox = new GroupBox( ); underlinedCheckBox = new CheckBox( ); strikethroughCheckBox = new CheckBox( ); scriptComboBox = new ComboBox( ); examplePanel = new Panel( ); colorComboBox = new ColorComboBox( this ); exampleGroupBox.SuspendLayout( ); effectsGroupBox.SuspendLayout( ); form.SuspendLayout( ); form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; // fontsizeListBox fontsizeListBox.Location = new Point( 284, 47 ); fontsizeListBox.Size = new Size( 52, 95 ); fontsizeListBox.TabIndex = 10; fontListBox.Sorted = true; // fontTextBox fontTextBox.Location = new Point( 16, 26 ); fontTextBox.Size = new Size( 140, 21 ); fontTextBox.TabIndex = 5; fontTextBox.Text = ""; // fontstyleLabel fontstyleLabel.Location = new Point( 164, 10 ); fontstyleLabel.Size = new Size( 100, 16 ); fontstyleLabel.TabIndex = 1; fontstyleLabel.Text = "Font Style:"; // typesizeTextBox fontsizeTextBox.Location = new Point( 284, 26 ); fontsizeTextBox.Size = new Size( 52, 21 ); fontsizeTextBox.TabIndex = 7; fontsizeTextBox.Text = ""; fontsizeTextBox.MaxLength = 2; // schriftartListBox fontListBox.Location = new Point( 16, 47 ); fontListBox.Size = new Size( 140, 95 ); fontListBox.TabIndex = 8; fontListBox.Sorted = true; // exampleGroupBox exampleGroupBox.Controls.Add( examplePanel ); exampleGroupBox.FlatStyle = FlatStyle.System; exampleGroupBox.Location = new Point( 164, 158 ); exampleGroupBox.Size = new Size( 172, 70 ); exampleGroupBox.TabIndex = 12; exampleGroupBox.TabStop = false; exampleGroupBox.Text = "Example"; // fontstyleListBox fontstyleListBox.Location = new Point( 164, 47 ); fontstyleListBox.Size = new Size( 112, 95 ); fontstyleListBox.TabIndex = 9; // schriftartLabel fontLabel.Location = new Point( 16, 10 ); fontLabel.Size = new Size( 88, 16 ); fontLabel.TabIndex = 0; fontLabel.Text = "Font:"; // effectsGroupBox effectsGroupBox.Controls.Add( underlinedCheckBox ); effectsGroupBox.Controls.Add( strikethroughCheckBox ); effectsGroupBox.Controls.Add( colorComboBox ); effectsGroupBox.FlatStyle = FlatStyle.System; effectsGroupBox.Location = new Point( 16, 158 ); effectsGroupBox.Size = new Size( 140, 116 ); effectsGroupBox.TabIndex = 11; effectsGroupBox.TabStop = false; effectsGroupBox.Text = "Effects"; // strikethroughCheckBox strikethroughCheckBox.FlatStyle = FlatStyle.System; strikethroughCheckBox.Location = new Point( 8, 16 ); strikethroughCheckBox.TabIndex = 0; strikethroughCheckBox.Text = "Strikethrough"; // colorComboBox colorComboBox.Location = new Point( 8, 70 ); colorComboBox.Size = new Size( 130, 21 ); // sizeLabel sizeLabel.Location = new Point( 284, 10 ); sizeLabel.Size = new Size( 100, 16 ); sizeLabel.TabIndex = 2; sizeLabel.Text = "Size:"; // scriptComboBox scriptComboBox.Location = new Point( 164, 253 ); scriptComboBox.Size = new Size( 172, 21 ); scriptComboBox.TabIndex = 14; scriptComboBox.DropDownStyle = ComboBoxStyle.DropDownList; // okButton okButton.FlatStyle = FlatStyle.System; okButton.Location = new Point( 352, 26 ); okButton.Size = new Size( 70, 23 ); okButton.TabIndex = 3; okButton.Text = "OK"; // cancelButton cancelButton.FlatStyle = FlatStyle.System; cancelButton.Location = new Point( 352, 52 ); cancelButton.Size = new Size( 70, 23 ); cancelButton.TabIndex = 4; cancelButton.Text = "Cancel"; // applyButton applyButton.FlatStyle = FlatStyle.System; applyButton.Location = new Point( 352, 78 ); applyButton.Size = new Size( 70, 23 ); applyButton.TabIndex = 5; applyButton.Text = "Apply"; // helpButton helpButton.FlatStyle = FlatStyle.System; helpButton.Location = new Point( 352, 104 ); helpButton.Size = new Size( 70, 23 ); helpButton.TabIndex = 6; helpButton.Text = "Help"; // underlinedCheckBox underlinedCheckBox.FlatStyle = FlatStyle.System; underlinedCheckBox.Location = new Point( 8, 36 ); underlinedCheckBox.TabIndex = 1; underlinedCheckBox.Text = "Underlined"; // fontstyleTextBox fontstyleTextBox.Location = new Point( 164, 26 ); fontstyleTextBox.Size = new Size( 112, 21 ); fontstyleTextBox.TabIndex = 6; fontstyleTextBox.Text = ""; // scriptLabel scriptLabel.Location = new Point( 164, 236 ); scriptLabel.Size = new Size( 100, 16 ); scriptLabel.TabIndex = 13; scriptLabel.Text = "Script:"; // examplePanel examplePanel.Location = new Point( 8, 20 ); examplePanel.TabIndex = 0; examplePanel.Size = new Size( 156, 40 ); examplePanel.BorderStyle = BorderStyle.Fixed3D; form.AcceptButton = okButton; form.CancelButton = cancelButton; form.Controls.Add( scriptComboBox ); form.Controls.Add( scriptLabel ); form.Controls.Add( exampleGroupBox ); form.Controls.Add( effectsGroupBox ); form.Controls.Add( fontsizeListBox ); form.Controls.Add( fontstyleListBox ); form.Controls.Add( fontListBox ); form.Controls.Add( fontsizeTextBox ); form.Controls.Add( fontstyleTextBox ); form.Controls.Add( fontTextBox ); form.Controls.Add( cancelButton ); form.Controls.Add( okButton ); form.Controls.Add( sizeLabel ); form.Controls.Add( fontstyleLabel ); form.Controls.Add( fontLabel ); form.Controls.Add( applyButton ); form.Controls.Add( helpButton ); exampleGroupBox.ResumeLayout( false ); effectsGroupBox.ResumeLayout( false ); form.Size = new Size( 430, 318 ); form.FormBorderStyle = FormBorderStyle.FixedDialog; form.MaximizeBox = false; form.Text = "Font"; form.ResumeLayout( false ); scriptComboBox.BeginUpdate (); scriptComboBox.Items.AddRange (char_sets_names); scriptComboBox.SelectedIndex = 0; scriptComboBox.EndUpdate (); applyButton.Hide( ); helpButton.Hide( ); colorComboBox.Hide( ); cancelButton.Click += new EventHandler( OnClickCancelButton ); okButton.Click += new EventHandler( OnClickOkButton ); applyButton.Click += new EventHandler (OnApplyButton); examplePanel.Paint += new PaintEventHandler( OnPaintExamplePanel ); fontListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedFontListBox ); fontsizeListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedSizeListBox ); fontstyleListBox.SelectedIndexChanged += new EventHandler( OnSelectedIndexChangedFontStyleListBox ); underlinedCheckBox.CheckedChanged += new EventHandler( OnCheckedChangedUnderlinedCheckBox ); strikethroughCheckBox.CheckedChanged += new EventHandler( OnCheckedChangedStrikethroughCheckBox ); scriptComboBox.SelectedIndexChanged += new EventHandler (OnSelectedIndexChangedScriptComboBox); fontTextBox.KeyPress += new KeyPressEventHandler (OnFontTextBoxKeyPress); fontstyleTextBox.KeyPress += new KeyPressEventHandler (OnFontStyleTextBoxKeyPress); fontsizeTextBox.KeyPress += new KeyPressEventHandler (OnFontSizeTextBoxKeyPress); fontTextBox.TextChanged += new EventHandler (OnFontTextBoxTextChanged); fontstyleTextBox.TextChanged += new EventHandler (OnFontStyleTextTextChanged); fontsizeTextBox.TextChanged += new EventHandler (OnFontSizeTextBoxTextChanged); fontTextBox.KeyDown += new KeyEventHandler (OnFontTextBoxKeyDown); fontstyleTextBox.KeyDown += new KeyEventHandler (OnFontStyleTextBoxKeyDown); fontsizeTextBox.KeyDown += new KeyEventHandler (OnFontSizeTextBoxKeyDown); fontTextBox.MouseWheel += new MouseEventHandler (OnFontTextBoxMouseWheel); fontstyleTextBox.MouseWheel += new MouseEventHandler (OnFontStyleTextBoxMouseWheel); fontsizeTextBox.MouseWheel += new MouseEventHandler (OnFontSizeTextBoxMouseWheel); PopulateFontList (); }
/// <summary> /// When worlds mode has been selected, it moves to the next page for /// the player to choose which world. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void worldButton_Click(object sender, EventArgs e) //Loads world selection buttons { //Will probably need to make this a class variable int numSubWorlds = 3; button_worldsMode.Hide(); button_endlessMode.Hide(); gameMain.ActiveForm.BackgroundImage = Mustache_ic___V2.Properties.Resources.bg1; gameMain.ActiveForm.BackgroundImageLayout = ImageLayout.Stretch; int xPanelSize = (gameMain.ActiveForm.Width - 25) / 2; int yPanelSize = (gameMain.ActiveForm.Height - 25) / 2; int xButtonSize = xPanelSize - 20; int yButtonSize = (yPanelSize - 250) / numSubWorlds; int controlOffset = 5; int panelVerticalOffset = (yPanelSize - (yButtonSize * numSubWorlds)) / (numSubWorlds - 1) - 75; //World 1 Panel & Buttons panel_world1 = new Panel(); panel_world1.Size = new Size(xPanelSize, yPanelSize); panel_world1.Location = new Point(controlOffset, controlOffset); panel_world1.Tag = 1; panel_world1.BackColor = Color.Transparent; list_button_sub_world1 = new List <Button>(); for (int i = 0; i < numSubWorlds; ++i) { Button bTmp = new Button(); bTmp.Text = "Dinosaur - World " + (i + 1); bTmp.TextAlign = ContentAlignment.MiddleCenter; bTmp.Font = new System.Drawing.Font("Comic Sans MS", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); bTmp.Size = new Size(xButtonSize, yButtonSize); bTmp.Tag = i + 1; bTmp.Click += new EventHandler(level_countdown); list_button_sub_world1.Add(bTmp); panel_world1.Controls.Add(list_button_sub_world1[i]); list_button_sub_world1[i].Location = new Point(controlOffset, i * yButtonSize + panelVerticalOffset * (i + 1)); } //World 2 button panel_world2 = new Panel(); panel_world2.Size = new Size(xPanelSize, yPanelSize); panel_world2.Location = new Point(2 * controlOffset + xPanelSize, controlOffset); panel_world2.Tag = 2; panel_world2.BackColor = Color.Transparent; list_button_sub_world2 = new List <Button>(numSubWorlds); for (int i = 0; i < numSubWorlds; ++i) { Button bTmp = new Button(); bTmp.Text = "Pet - World " + (i + 1); bTmp.TextAlign = ContentAlignment.MiddleCenter; bTmp.Font = new System.Drawing.Font("Comic Sans MS", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); bTmp.Size = new Size(xButtonSize, yButtonSize); bTmp.Tag = i + 1; bTmp.Click += new EventHandler(level_countdown); list_button_sub_world2.Add(bTmp); panel_world2.Controls.Add(list_button_sub_world2[i]); list_button_sub_world2[i].Location = new Point(controlOffset, i * yButtonSize + panelVerticalOffset * (i + 1)); } //World 3 button panel_world3 = new Panel(); panel_world3.Size = new Size(xPanelSize, yPanelSize); panel_world3.Location = new Point(controlOffset, 2 * controlOffset + yPanelSize); panel_world3.Tag = 3; panel_world3.BackColor = Color.Transparent; list_button_sub_world3 = new List <Button>(numSubWorlds); for (int i = 0; i < numSubWorlds; ++i) { Button bTmp = new Button(); bTmp.Text = "Aquatic - World " + (i + 1); bTmp.TextAlign = ContentAlignment.MiddleCenter; bTmp.Font = new System.Drawing.Font("Comic Sans MS", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); bTmp.Size = new Size(xButtonSize, yButtonSize); bTmp.Tag = i + 1; bTmp.Click += new EventHandler(level_countdown); list_button_sub_world3.Add(bTmp); panel_world3.Controls.Add(list_button_sub_world3[i]); list_button_sub_world3[i].Location = new Point(controlOffset, i * yButtonSize + panelVerticalOffset * (i + 1)); } //World 4 Button panel_world4 = new Panel(); panel_world4.Size = new Size(xPanelSize, yPanelSize); panel_world4.Location = new Point(2 * controlOffset + xPanelSize, 2 * controlOffset + yPanelSize); panel_world4.Tag = 4; panel_world4.BackColor = Color.Transparent; list_button_sub_world4 = new List <Button>(numSubWorlds); for (int i = 0; i < numSubWorlds; ++i) { Button bTmp = new Button(); bTmp.Text = "Dinosaur - World " + (i + 1); bTmp.TextAlign = ContentAlignment.MiddleCenter; bTmp.Font = new System.Drawing.Font("Comic Sans MS", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); bTmp.Size = new Size(xButtonSize, yButtonSize); bTmp.Tag = i + 1; bTmp.Click += new EventHandler(level_countdown); list_button_sub_world4.Add(bTmp); panel_world4.Controls.Add(list_button_sub_world4[i]); list_button_sub_world4[i].Location = new Point(controlOffset, i * yButtonSize + panelVerticalOffset * (i + 1)); } this.Controls.Add(panel_world1); this.Controls.Add(panel_world2); this.Controls.Add(panel_world3); this.Controls.Add(panel_world4); }