void MyszClick(object sender, MouseEventArgs e) { if (ikona.Image != bp) { foreach (Control c in tabPage.Controls) //odlikniecie pozostalych ikon { if (c is TransparentPictureBox) { TransparentPictureBox pb = ((TransparentPictureBox)c); if (pb.Image == bp) //tylko jesli nie klikniety { pb.Image = bgSmall; } } } ikona.Image = bp; WypelnijPanel(); nazwaMiasta.Visible = false; } else { //mysz nad przyciskiem ikona.Image = bg; nazwaMiasta.Visible = true; panelMiasto.Visible = false; } }
public void start(object sender, EventArgs e) { TransparentPictureBox b = sender as TransparentPictureBox; Controls.Remove(b); Thread bird_thread = new Thread(moveBird); bird_thread.Start(); Thread pipes_thread = new Thread(generatePipes); pipes_thread.Start(); }
private void createNewGame() { TransparentPictureBox start_button = new TransparentPictureBox(); start_button.Click += new EventHandler(start); start_button.Location = new Point(300, 200); start_button.Size = new Size(200, 100); start_button.Padding = new Padding(5); start_button.Dock = DockStyle.Fill; start_button.Image = Consts.ResizeImage(Desktop_Minigames.Properties.Resources.flappy_bird_start_button, 200, 100); Controls.Add(start_button); bird.Location = new Point(200, 200); gameOver = false; gameCounter = 0; changeCounter(); }
public ImportForm() { InitializeComponent(); pictureBox1.Hide(); loadingPictureBox = new TransparentPictureBox(); loadingPictureBox.Image = myResouces.Loader; openFileDialog1 = new OpenFileDialog { InitialDirectory = @"c:\", Title = "Browse Student CSV File", CheckFileExists = true, CheckPathExists = true, DefaultExt = "csv", Filter = "csv files (*.csv)|*.csv", RestoreDirectory = true, ReadOnlyChecked = true, ShowReadOnly = true }; }
public FlappyBird() { InitializeComponent(); this.Size = new Size(800, 400 + Consts.BIRD_HEIGHT * 2 - 15); Image bird_image = Desktop_Minigames.Properties.Resources.flappy_bird_bird; bird_image = Consts.ResizeImage(bird_image, Consts.BIRD_WIDTH, Consts.BIRD_HEIGHT); Image background_image = Desktop_Minigames.Properties.Resources.flappy_bird_background; background_image = Consts.ResizeImage(background_image, this.Width, this.Height); gameCounterLabel.Text = "" + gameCounter; gameCounterLabel.Font = new Font("Arial", 20); gameCounterLabel.Size = new Size(50, 50); gameCounterLabel.BackColor = Color.Transparent; Controls.Add(gameCounterLabel); bird = new PictureBox(); bird.BackColor = Color.Transparent; bird.Size = new Size(Consts.BIRD_WIDTH, Consts.BIRD_HEIGHT); bird.Image = bird_image; bird.Location = new Point(200, 200); this.BackgroundImage = background_image; Controls.Add(bird); TransparentPictureBox start_button = new TransparentPictureBox(); start_button.Click += new EventHandler(start); start_button.Location = new Point(300, 200); start_button.Size = new Size(200, 100); start_button.Padding = new Padding(5); start_button.Dock = DockStyle.Fill; start_button.Image = Consts.ResizeImage(Desktop_Minigames.Properties.Resources.flappy_bird_start_button, 200, 100); Controls.Add(start_button); }
private void SetRightBrandingImage() { this.GetRightBrandingInfo(); if (this._rightBrandingImageBitmap == null) return; TransparentPictureBox transparentPictureBox = new TransparentPictureBox(); transparentPictureBox.TheBitmap = new Bitmap((Image) this._rightBrandingImageBitmap); transparentPictureBox.Size = new Size(transparentPictureBox.TheBitmap.Width, DPIUtils.UnscaleY(transparentPictureBox.TheBitmap.Height)); transparentPictureBox.Location = new Point(this.Size.Width - transparentPictureBox.TheBitmap.Width, (this.Size.Height - DPIUtils.UnscaleY(transparentPictureBox.TheBitmap.Height)) / 2); transparentPictureBox.Name = "RightBrandingImageBitmap"; transparentPictureBox.AccessibleName = "RightBrandingImageBitmap"; transparentPictureBox.TabStop = false; this.Controls.Add((Control) transparentPictureBox); if (this._rightBrandingImageURL == null) return; transparentPictureBox.MouseEnter += new EventHandler(this.OnBrandingImageMouseEnter); transparentPictureBox.MouseLeave += new EventHandler(this.OnBrandingImageMouseLeave); transparentPictureBox.MouseDown += new MouseEventHandler(this.OnRightBrandingImageMouseDown); this._rightBrandingImageTooltip.SetToolTip((Control) transparentPictureBox, this._rightBrandingImageURL.Trim()); }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ConnectionDetails)); this.ConnectedIcon = new TransparentPictureBox(); this.SignalIcon = new TransparentPictureBox(); this.NetworkDetailsPanel = new Panel(); this.NetworkDetailsBottomPanel = new Panel(); this.BottomPanel_LinkLabel = new LinkLabel(); this.NetworkDetailsTopPanel = new Panel(); this.TopPanel_NetworkNameLbl = new Label(); this.TopPanel_ConnectedToLbl = new Label(); this.NetworkDetailsPanel.SuspendLayout(); this.NetworkDetailsBottomPanel.SuspendLayout(); this.NetworkDetailsTopPanel.SuspendLayout(); this.SuspendLayout(); this.ConnectedIcon.BackColor = Color.Transparent; componentResourceManager.ApplyResources((object) this.ConnectedIcon, "ConnectedIcon"); this.ConnectedIcon.ImageFilename = "Resources.Placeholder.icon_connected_wired.png"; this.ConnectedIcon.Name = "ConnectedIcon"; this.ConnectedIcon.TabStop = false; this.ConnectedIcon.TheBitmap = (Bitmap) null; this.SignalIcon.BackColor = Color.Transparent; componentResourceManager.ApplyResources((object) this.SignalIcon, "SignalIcon"); this.SignalIcon.ImageFilename = "Resources.Buttons.btn_help.png"; this.SignalIcon.Name = "SignalIcon"; this.SignalIcon.TabStop = false; this.SignalIcon.TheBitmap = (Bitmap) null; componentResourceManager.ApplyResources((object) this.NetworkDetailsPanel, "NetworkDetailsPanel"); this.NetworkDetailsPanel.Controls.Add((Control) this.NetworkDetailsBottomPanel); this.NetworkDetailsPanel.Controls.Add((Control) this.NetworkDetailsTopPanel); this.NetworkDetailsPanel.Name = "NetworkDetailsPanel"; this.NetworkDetailsBottomPanel.Controls.Add((Control) this.BottomPanel_LinkLabel); componentResourceManager.ApplyResources((object) this.NetworkDetailsBottomPanel, "NetworkDetailsBottomPanel"); this.NetworkDetailsBottomPanel.Name = "NetworkDetailsBottomPanel"; componentResourceManager.ApplyResources((object) this.BottomPanel_LinkLabel, "BottomPanel_LinkLabel"); this.BottomPanel_LinkLabel.Name = "BottomPanel_LinkLabel"; this.BottomPanel_LinkLabel.TabStop = true; componentResourceManager.ApplyResources((object) this.NetworkDetailsTopPanel, "NetworkDetailsTopPanel"); this.NetworkDetailsTopPanel.Controls.Add((Control) this.TopPanel_NetworkNameLbl); this.NetworkDetailsTopPanel.Controls.Add((Control) this.TopPanel_ConnectedToLbl); this.NetworkDetailsTopPanel.Name = "NetworkDetailsTopPanel"; componentResourceManager.ApplyResources((object) this.TopPanel_NetworkNameLbl, "TopPanel_NetworkNameLbl"); this.TopPanel_NetworkNameLbl.Name = "TopPanel_NetworkNameLbl"; componentResourceManager.ApplyResources((object) this.TopPanel_ConnectedToLbl, "TopPanel_ConnectedToLbl"); this.TopPanel_ConnectedToLbl.ForeColor = Color.FromArgb(42, 125, 193); this.TopPanel_ConnectedToLbl.Name = "TopPanel_ConnectedToLbl"; this.TopPanel_ConnectedToLbl.TabStop = true; this.TopPanel_ConnectedToLbl.UseCompatibleTextRendering = true; this.Controls.Add((Control) this.NetworkDetailsPanel); this.Controls.Add((Control) this.SignalIcon); this.Controls.Add((Control) this.ConnectedIcon); componentResourceManager.ApplyResources((object) this, "$this"); this.Name = "ConnectionDetails"; this.NetworkDetailsPanel.ResumeLayout(false); this.NetworkDetailsBottomPanel.ResumeLayout(false); this.NetworkDetailsTopPanel.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TaskView)); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnComplete = new TransparentPictureBox(); this.btnRemove = new TransparentPictureBox(); this.btnUp = new TransparentPictureBox(); this.btnDown = new TransparentPictureBox(); this.lblTaskPath = new MindMate.Plugins.Tasks.TransparentLabel(); this.lblDueOn = new MindMate.Plugins.Tasks.TransparentLabel(); this.lblNodeName = new MindMate.Plugins.Tasks.TransparentLabel(); this.SuspendLayout(); // // btnRemove // this.btnRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnRemove.BackColor = System.Drawing.Color.Transparent; this.btnRemove.Image = TaskRes.date_delete; this.btnRemove.Location = new System.Drawing.Point(1221, 3); this.btnRemove.Name = "btnRemove"; this.btnRemove.Size = new System.Drawing.Size(18, 18); this.btnRemove.TabIndex = 3; this.toolTip1.SetToolTip(this.btnRemove, "Remove Task"); // // btnComplete // this.btnComplete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnComplete.BackColor = System.Drawing.Color.Transparent; this.btnComplete.Image = TaskRes.tick; this.btnComplete.Location = new System.Drawing.Point(1200, 3); this.btnComplete.Name = "btnComplete"; this.btnComplete.Size = new System.Drawing.Size(18, 18); this.btnComplete.TabIndex = 4; this.toolTip1.SetToolTip(this.btnComplete, "Complete Task"); // // btnDown // this.btnDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnDown.BackColor = System.Drawing.Color.Transparent; this.btnDown.Image = TaskRes.arrow_270_medium; this.btnDown.Location = new System.Drawing.Point(1179, 3); this.btnDown.Name = "btnDown"; this.btnDown.Size = new System.Drawing.Size(18, 18); this.btnDown.TabIndex = 3; this.toolTip1.SetToolTip(this.btnRemove, "Move Down"); // // btnUp // this.btnUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnUp.BackColor = System.Drawing.Color.Transparent; this.btnUp.Image = TaskRes.arrow_090_medium; this.btnUp.Location = new System.Drawing.Point(1158, 3); this.btnUp.Name = "btnUp"; this.btnUp.Size = new System.Drawing.Size(18, 18); this.btnUp.TabIndex = 3; this.toolTip1.SetToolTip(this.btnRemove, "Move Up"); // // lblTaskPath // this.lblTaskPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblTaskPath.AutoEllipsis = true; this.lblTaskPath.ForeColor = System.Drawing.Color.Gray; this.lblTaskPath.Location = new System.Drawing.Point(7, 22); this.lblTaskPath.Name = "lblTaskPath"; this.lblTaskPath.Size = new System.Drawing.Size(1170, 16); this.lblTaskPath.TabIndex = 2; this.lblTaskPath.Text = "Blogging -> My Tasks -> Important Ones -> My Mind"; // // lblDueOn // this.lblDueOn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblDueOn.ForeColor = System.Drawing.Color.Gray; this.lblDueOn.Location = new System.Drawing.Point(1183, 22); this.lblDueOn.Name = "lblDueOn"; this.lblDueOn.Size = new System.Drawing.Size(57, 16); this.lblDueOn.TabIndex = 1; this.lblDueOn.Text = "12:00 AM"; this.lblDueOn.TextAlign = System.Drawing.ContentAlignment.TopRight; // // lblNodeName // this.lblNodeName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblNodeName.AutoEllipsis = true; this.lblNodeName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblNodeName.Location = new System.Drawing.Point(4, 4); this.lblNodeName.Name = "lblNodeName"; this.lblNodeName.Size = new System.Drawing.Size(1235, 23); this.lblNodeName.TabIndex = 0; this.lblNodeName.Text = "Create a new Post on Animal Rights in Islam"; // // TaskView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLight; this.Controls.Add(this.btnComplete); this.Controls.Add(this.btnRemove); this.Controls.Add(this.btnDown); this.Controls.Add(this.btnUp); this.Controls.Add(this.lblTaskPath); this.Controls.Add(this.lblDueOn); this.Controls.Add(this.lblNodeName); this.Name = "TaskView"; this.Size = new System.Drawing.Size(1243, 42); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.TaskView_MouseUp); this.ResumeLayout(false); }
/////////////////////////////////////////////////////// Constructor /////////////////////////////////////////////////////// public WumpusUI2(Form gameForm, PictureBox player, PictureBox bat, PictureBox[] pits, PictureBox wumpus, PictureBox room, PictureBox door, PictureBox gold, PictureBox arrow, PictureBox fireball, PictureBox secret, PictureBox win, PictureBox death, Button playGameButton, Button highScoreButton, Button exitGameButton) { //make all of the doors doors = new TransparentPictureBox[6]; for (int i = 0; i < doors.Length; i++) { TransparentPictureBox newDoor = new TransparentPictureBox(3); newDoor.Image = door.Image; gameForm.Controls.Add(newDoor); doors[i] = newDoor; } // passes in the game form this.gameForm = gameForm; // highScore = new HighScore(); // get screen dimensions scX = Screen.FromControl(gameForm).Bounds.Width; scY = Screen.FromControl(gameForm).Bounds.Height; /////////////// Main Menu ////////////// this.playGameButton = playGameButton; this.highScoreButton = highScoreButton; this.exitGameButton = exitGameButton; playGameButton.Click += new System.EventHandler(playGameButton_Click); highScoreButton.Click += new System.EventHandler(highScoreButton_Click); exitGameButton.Click += new System.EventHandler(exitGameButton_Click); //////////// HighScore Form //////////// highScoreForm = makeForm("High-scores", scX / 3, scY * 3 / 4); highScoreForm.Controls.Add(nameHeader); highScoreForm.Controls.Add(scoreHeader); iniHighScore(); exitHighScore = makeButton("Exit", highScoreForm.Width * 5 / 6, highScoreForm.Height * 7 / 8); highScoreForm.Controls.Add(exitHighScore); /////////////// Shop Form ////////////// shopForm = makeForm("Shop", scX / 3, scY * 1 / 2); // buyArrow Button buyArrow = makeButton("Buy", shopForm.Width * 2 / 3, shopForm.Height * 2 / 5); buyArrow.Click += new System.EventHandler(buyArrow_Click); // buySecret Button buySecret = makeButton("Buy", shopForm.Width * 2 / 3, shopForm.Height * 3 / 5); buySecret.Click += new System.EventHandler(buySecret_Click); // exitShop Button exitShop = makeButton("Exit", shopForm.Width * 2 / 3, shopForm.Height * 4 / 5); exitShop.Click += new System.EventHandler(exitShop_Click); shopForm.Controls.Add(buyArrow); shopForm.Controls.Add(buySecret); shopForm.Controls.Add(exitShop); //////////////////////////////// on screen GUI //////////////////////////////////// shopButton = makeButton("Shop", scX * 1 / 10, scY * 4 / 5); shopButton.Click += new System.EventHandler(shopButton_Click); gameForm.Controls.Add(shopButton); // player stats golds = makeLabel("0", scX * 1 / 10, scY * 7 / 8); arrows = makeLabel("0", scX * 2 / 10, scY * 7 / 8); secrets = makeLabel("0", scX * 3 / 10, scY * 7 / 8); // initial locations this.player = player; player.Location = new System.Drawing.Point(scX / 2, scY / 2); this.gold = gold; this.gold.Location = new System.Drawing.Point(scX / 10, scY * 7 / 9); this.secret = secret; this.secret.Location = new System.Drawing.Point(scX / 10, scY * 7 / 9); this.arrow = arrow; this.arrow.Location = new Point(scX / 10, scY * 7 / 9); this.fireball = fireball; this.fireball.Location = new Point(scX * 4 / 3, scY * 4 / 3); // message pane messages = makeTextBox(scX / 6, scY / 4, scX * 10 / 13, scY / 13); messages.Text = "HEYOOOO"; messages.Show(); ////////////////////////////////// end of GUI ///////////////////////////////////// // single dynamic game images this.bat = bat; this.pits = pits; this.wumpus = wumpus; this.room = room; this.door = door; // multiple projectile images arrowList = new List <PictureBox>(); fireballList = new List <PictureBox>(); // end game this.win = win; this.death = death; mainMenu = makeButton("Main Menu", scX / 2, scY * 7 / 8); }