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. Visual Basic
  4. Detecting when a child form is being moved

Detecting when a child form is being moved

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 2 Posters 16 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.
  • G Offline
    G Offline
    Georg Kohler
    wrote on last edited by
    #1

    I was wondering if somebody can point me in the right direction on this - The goal is to detect when a child form is being moved and read out the current position while moving -I could use a timer to read out the current position - but at this point I have not been able to fire an event that indicates the form being moved or not ( grabbed by the tool bar that is) This is just a normal form with standard close minimize / maximize buttons (Not that that should make a difference I assume) What am I missing ? Any ideas ? Georg

    D 1 Reply Last reply
    0
    • G Georg Kohler

      I was wondering if somebody can point me in the right direction on this - The goal is to detect when a child form is being moved and read out the current position while moving -I could use a timer to read out the current position - but at this point I have not been able to fire an event that indicates the form being moved or not ( grabbed by the tool bar that is) This is just a normal form with standard close minimize / maximize buttons (Not that that should make a difference I assume) What am I missing ? Any ideas ? Georg

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You're missing the Form.Move event. All you have to do is handle that event in your form code and you can get the Top and Left property values for the position of the form.

      Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
      Dave Kreskowiak

      G 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You're missing the Form.Move event. All you have to do is handle that event in your form code and you can get the Top and Left property values for the position of the form.

        Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
        Dave Kreskowiak

        G Offline
        G Offline
        Georg Kohler
        wrote on last edited by
        #3

        That's what I thought - unfortunately that event does not fire for me.... Is there a setting in the parent that could prevent that event from firing ? Georg

        D 1 Reply Last reply
        0
        • G Georg Kohler

          That's what I thought - unfortunately that event does not fire for me.... Is there a setting in the parent that could prevent that event from firing ? Georg

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          That means there is no code "wiring-up" the event handler. If you're looking at the position of Form2 from inside Form1 code, you have to "wire up" the event yourself. If you're only looking at the position of Form2 inside Form2 code, the event isn't getting wired up in the Designer code. Which is it?

          Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
          Dave Kreskowiak

          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