|
-
Mar 17th, 2006, 03:06 PM
#1
Thread Starter
Lively Member
Ack, need coding help
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
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?
Last edited by PsychoticPsymon; Mar 18th, 2006 at 08:36 AM.
AZURE
Act 1: Ruby
Act 2: Cavara Militari
Act 3:
Act 4:
Act 5: Cogito ergo sum
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|