Results 1 to 3 of 3

Thread: Ack, need coding help

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Location
    New York
    Posts
    94

    Ack, need coding help

    VB Code:
    1. //Section1
    2.             PictureBox picBoard = new PictureBox();
    3.             this.Controls.Add(picBoard);
    4.             picBoard.MouseDown += new System.Windows.Forms.MouseEventHandler(picBoard_MouseDown);
    5. //Section1
    6. //Section2
    7.         private void picBoard_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    8.         {
    9.             /*  1   2   3   4   5   6   7   8
    10.              *  9   10  11  12  13  14  15  16
    11.              *  17  18  19  20  21  22  23  24
    12.              *  25  26  27  28  29  30  31  32
    13.              *  33  34  35  36  37  38  39  40
    14.              *  41  42  43  44  45  46  47  48
    15.              *  49  50  51  52  53  54  55  56
    16.              *  57  58  59  60  61  62  63  64*/
    17.             int TotalX = [B]sender.Size.Width[/B], TotalY = [B]sender.Size.Height[/B], ClickX = e.X, ClickY = e.Y;
    18. *snip*
    19.         }
    20. //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
  •  



Click Here to Expand Forum to Full Width