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. assigning location of object

assigning location of object

Scheduled Pinned Locked Moved C#
help
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.
  • D Offline
    D Offline
    dsl fahk
    wrote on last edited by
    #1

    i am trying to move a panel with:

    pnlProgressBar.Location.X = pnlProgressBar.Location.X + 1;

    for a progress bar. It is inside a while loop, but the following error occurs: "Cannot modify the return value of 'System.Windows.Control.Location' because it is not a variable" I want it to later be able to actually show the amount of progress it has actually made, but first i need it to be able to move. If anybody else has a better way of making a progress bar that is only one bar, unlike the built in progress bar, please tell me. thanks in advance.

    C 1 Reply Last reply
    0
    • D dsl fahk

      i am trying to move a panel with:

      pnlProgressBar.Location.X = pnlProgressBar.Location.X + 1;

      for a progress bar. It is inside a while loop, but the following error occurs: "Cannot modify the return value of 'System.Windows.Control.Location' because it is not a variable" I want it to later be able to actually show the amount of progress it has actually made, but first i need it to be able to move. If anybody else has a better way of making a progress bar that is only one bar, unlike the built in progress bar, please tell me. thanks in advance.

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      dsl/fahk wrote:

      Cannot modify the return value of 'System.Windows.Control.Location' because it is not a variable"

      Location returns a Point structure. Point is immutable meaning once it has been created it cannot be changed. You have to assign a new Point to the Location property of the control.


      Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

      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