Dragging Borderless Forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Liz

    #1

    Dragging Borderless Forms


    I need to implement dragging a borderless form by clicking/dragging on the
    form surface. Using the "standard" approach (setting "CanMove" flag on
    MouseDown, moving the form by the delta of the absolute mouse movement,
    unsetting the "CanMove" flag on MouseUp) I am getting a lot of "jerky"
    movement of the form and can't seem to get it smooth.

    I also have noticed that MouseMove seems to fire even when there is no
    motion of the mouse at all (?) ... I'm using a wireless mouse; does that
    make a difference ?

    Can anyone point me to a solution that implements smooth movement of the
    form on mouse dragging ? I would think this is a pretty common problem
    ......

    TIA



  • Mick Doherty

    #2
    Re: Dragging Borderless Forms

    Expert WinForms tips, tricks, and code snippets for .NET developers.


    --
    Mick Doherty
    Dotnetrix offers Nothing. Standard and Premium versions available.



    "Liz" <liz@no-spam.org> wrote in message
    news:Ri92g.4271 2$zy2.40333@fe0 8.news.easynews .com...[color=blue]
    >
    > I need to implement dragging a borderless form by clicking/dragging on the
    > form surface. Using the "standard" approach (setting "CanMove" flag on
    > MouseDown, moving the form by the delta of the absolute mouse movement,
    > unsetting the "CanMove" flag on MouseUp) I am getting a lot of "jerky"
    > movement of the form and can't seem to get it smooth.
    >
    > I also have noticed that MouseMove seems to fire even when there is no
    > motion of the mouse at all (?) ... I'm using a wireless mouse; does that
    > make a difference ?
    >
    > Can anyone point me to a solution that implements smooth movement of the
    > form on mouse dragging ? I would think this is a pretty common problem
    > .....
    >
    > TIA
    >
    >
    >[/color]


    Comment

    • Liz

      #3
      Re: Dragging Borderless Forms


      "Mick Doherty"
      <EXCHANGE#WITH@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
      message news:%23ECiUnXZ GHA.4424@TK2MSF TNGP05.phx.gbl. ..[color=blue]
      > http://www.dotnetrix.co.uk/misc.html[/color]

      Works great, Mick .... thank you ... now I have to figure out WHY and HOW
      they work ! It appears that the essence of the algorithm is "tricking"
      Windows into thinking the user clicked on the title bar rather than the
      client area of the form .... (???) .... clever ....

      L



      [color=blue]
      > --
      > Mick Doherty
      > http://dotnetrix.co.uk/nothing.html
      >
      >
      > "Liz" <liz@no-spam.org> wrote in message
      > news:Ri92g.4271 2$zy2.40333@fe0 8.news.easynews .com...[color=green]
      >>
      >> I need to implement dragging a borderless form by clicking/dragging on
      >> the form surface. Using the "standard" approach (setting "CanMove" flag
      >> on MouseDown, moving the form by the delta of the absolute mouse
      >> movement, unsetting the "CanMove" flag on MouseUp) I am getting a lot of
      >> "jerky" movement of the form and can't seem to get it smooth.
      >>
      >> I also have noticed that MouseMove seems to fire even when there is no
      >> motion of the mouse at all (?) ... I'm using a wireless mouse; does that
      >> make a difference ?
      >>
      >> Can anyone point me to a solution that implements smooth movement of the
      >> form on mouse dragging ? I would think this is a pretty common problem
      >> .....
      >>
      >> TIA
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Mick Doherty

        #4
        Re: Dragging Borderless Forms


        "Liz" <liz@no-spam.org> wrote in message
        news:Vxi2g.5589 2$Qb5.20179@fe0 1.news.easynews .com...[color=blue]
        >
        > Works great, Mick .... thank you ...[/color]

        You're welcome!
        [color=blue]
        >now I have to figure out WHY and HOW they work ! It appears that the
        >essence of the algorithm is "tricking" Windows into thinking the user
        >clicked on the title bar rather than the client area of the form .... (???)
        >.... clever ....[/color]

        That's exactly how it works.

        --
        Mick Doherty
        Dotnetrix offers Nothing. Standard and Premium versions available.



        Comment

        Working...