Mouse [vb.net] 마우스 드레그로 컨트롤 사이즈 변경 / 영역 사이즈 변경
페이지 정보

본문
    Private Sub Panel_x_MouseDown(sender As Object, e As MouseEventArgs) Handles Panel9.MouseDown, Panel8.MouseDown, Panel7.MouseDown
        If sender Is Panel9 Then
            Windows.Forms.Cursor.Current = Cursors.HSplit
        Else
            Windows.Forms.Cursor.Current = Cursors.VSplit
        End If
        DirectCast(sender, Panel).Tag = {1, e.X, e.Y}
    End Sub
    Private Sub Panel_x_MouseUp(sender As Object, e As MouseEventArgs) Handles Panel9.MouseUp, Panel8.MouseUp, Panel7.MouseUp
        Windows.Forms.Cursor.Current = Cursors.Default
        sender.Tag = Nothing
    End Sub
    Private Sub Panel_x_MouseMove(sender As Object, e As MouseEventArgs) Handles Panel9.MouseMove, Panel8.MouseMove, Panel7.MouseMove
        If sender.Tag Is Nothing Then Return
        Dim PN As Panel = DirectCast(sender, Panel)
        Dim P() As Integer = PN.Tag
        If PN Is Panel7 Then
            Panel2.Width += P(1) - e.X
        ElseIf PN Is Panel8 Then
            Panel1.Width += e.X - P(1)
        ElseIf PN Is Panel9 Then
            Panel4.Height += P(2) - e.Y
        End If
    End Sub
    Private Sub Panel_x_MouseMove(sender As Object, e As MouseEventArgs) Handles pn_2.MouseMove, pn_1.MouseMove
        If sender Is pn_1 Then
            Windows.Forms.Cursor.Current = Cursors.VSplit
        Else
            Windows.Forms.Cursor.Current = Cursors.HSplit
        End If
        If sender.Tag Is Nothing Then Return
        Dim PN As Panel = DirectCast(sender, Panel)
        Dim P() As Integer = PN.Tag
        If PN Is pn_1 Then
            GroupBox9.Width += e.X - P(1)
        ElseIf PN Is pn_2 Then
            GroupBox10.Height += e.Y - P(2)
        End If
    End Sub
- 이전글[vb.net] IWebDriver chrome.exe 지정 및 user data, profile 경로 지정하기 22.10.09
 - 다음글[vb.net] Create Animated Gif 22.10.05
 
댓글목록
등록된 댓글이 없습니다.



