How can I get it so that I can, in section 2, get the size of the picturebox that I have created. In other words, when I click on picBoard, how can I make it so that picBoard is the sender without messing up a different part of the application?VB Code:
//Section1 PictureBox picBoard = new PictureBox(); this.Controls.Add(picBoard); picBoard.MouseDown += new System.Windows.Forms.MouseEventHandler(picBoard_MouseDown); //Section1 //Section2 private void picBoard_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { /* 1 2 3 4 5 6 7 8 * 9 10 11 12 13 14 15 16 * 17 18 19 20 21 22 23 24 * 25 26 27 28 29 30 31 32 * 33 34 35 36 37 38 39 40 * 41 42 43 44 45 46 47 48 * 49 50 51 52 53 54 55 56 * 57 58 59 60 61 62 63 64*/ int TotalX = [B]sender.Size.Width[/B], TotalY = [B]sender.Size.Height[/B], ClickX = e.X, ClickY = e.Y; *snip* } //Section2
