1 Replies - 3496 Views - Last Post: 20 November 2010 - 03:49 PM Rate Topic: -----

#1 sak904  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 72
  • Joined: 03-September 09

Smooth Borderless Resize?

Posted 20 November 2010 - 12:33 PM

Hi, I am working on making a borderless form resize, but every time you move the mouse while resizing, it starts blinking until you are done. Is there a smoother borderless resize?

Here is the code I have right now

   Dim CurLocation, AppLocation As New Point(0, 0)

    Private Sub Sync()
        CurLocation = Cursor.Position
        AppLocation = Me.Size
    End Sub

    Private Sub panel3_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseDown
        ResizeTimer.Start()
        Sync()
    End Sub

    Private Sub panel3_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseUp
        ResizeTimer.Stop()
        Sync()
    End Sub

    Private Sub ResizeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResizeTimer.Tick

  Me.Size = AppLocation - CurLocation + Cursor.Position

 


    End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Smooth Borderless Resize?

#2 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Smooth Borderless Resize?

Posted 20 November 2010 - 03:49 PM

Don't know what your timer is set at but I personally wouldn't use it. I would put the following in the Panel3_MouseMove event
   Private Sub Panel3_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseMove
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Me.Size = AppLocation - CurLocation + Cursor.Position
        End If
    End Sub

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1