Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Troubles with parsing data from on function to another

Troubles with parsing data from on function to another

Scheduled Pinned Locked Moved C#
graphicsdata-structuresjsonhelpannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yannielsen
    wrote on last edited by
    #1

    Hi, I have a class where i'm creating a ButtonArray. Once i have created some elements in this array i want to access each of them in order to move them around in a panel. However i can't seem to get the information from the Move() funtion to be used in the MouseUpHandler which is the one handling the release of a button press (dropping the button at a new location). Could anyone please help me out here, and please do say if you need more code than i have provided. public void MouseUpHandler(object sender, System.Windows.Forms.MouseEventArgs e) { this.Move((System.Windows.Forms.Button) sender).Tag), host, _iXCoorRelative, _iYCoorRelative); } public void Move(object sender, System.Windows.Forms.Control host, int _iXCoorRelative, int _iYCoorRelative) { ButtonArray btnArray = new ButtonArray(host); btnArray[Convert.ToInt32(((System.Windows.Forms.Button) sender).Tag)].Location = new System.Drawing.Point (_iXCoorRelative, _iYCoorRelative); }

    G 1 Reply Last reply
    0
    • Y Yannielsen

      Hi, I have a class where i'm creating a ButtonArray. Once i have created some elements in this array i want to access each of them in order to move them around in a panel. However i can't seem to get the information from the Move() funtion to be used in the MouseUpHandler which is the one handling the release of a button press (dropping the button at a new location). Could anyone please help me out here, and please do say if you need more code than i have provided. public void MouseUpHandler(object sender, System.Windows.Forms.MouseEventArgs e) { this.Move((System.Windows.Forms.Button) sender).Tag), host, _iXCoorRelative, _iYCoorRelative); } public void Move(object sender, System.Windows.Forms.Control host, int _iXCoorRelative, int _iYCoorRelative) { ButtonArray btnArray = new ButtonArray(host); btnArray[Convert.ToInt32(((System.Windows.Forms.Button) sender).Tag)].Location = new System.Drawing.Point (_iXCoorRelative, _iYCoorRelative); }

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Why does it "seem" like you can't get the information? What happens? Where do you declare the host, _iXCoorRelative and _iYCoorRelaive variables, and where do you specify the values for them? You send the contents of the Tag object of the button as sender to the Move method, then you reference the contents as a Button object. Do you really store a reference to a button in the Tag object of the button? --- b { font-weight: normal; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups