Создание красивого дизайна в Visual Studio

Sub New()

' This call is required by the designer.
InitializeComponent()

' Add any initialization after the InitializeComponent() call.
AddHandler Me.MouseDown, New MouseEventHandler(AddressOf ctl_MouseDown)
AddHandler Me.MouseMove, New MouseEventHandler(AddressOf ctl_MouseMove)
AddHandler Me.MouseUp, New MouseEventHandler(AddressOf ctl_MouseUp)


End Sub


#Region "MOUSE EVENTS ON PANEL CONTROL"
Private m_WindowsState As FormWindowState = FormWindowState.Normal
Private m_MousePressed As Boolean = False
Private m_oldX As Integer, m_oldY As Integer
Private Sub ctl_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim TS As Point = Me.PointToScreen(e.Location)
m_oldX = TS.X
m_oldY = TS.Y
m_MousePressed = True
End Sub
Private Sub ctl_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs)
m_MousePressed = False
End Sub
Private Sub ctl_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
If m_MousePressed = True AndAlso m_WindowsState <> FormWindowState.Maximized Then
Dim TS As Point = Me.PointToScreen(e.Location)
Me.Location = New Point(Me.Location.X + (TS.X - m_oldX), Me.Location.Y + (TS.Y - m_oldY))
m_oldX = TS.X
m_oldY = TS.Y
End If
End Sub
#End Region

Только зарегистрированные пользователи могут оставлять комментарии. Войдите, пожалуйста.

    Возможно, Вас заинтересует