sender.Size = New Size(sender.Width + e.X - p1.X, sender.Height + e.Y - p1.Y) Case EnumMousePointPosition.MouseSizeRight sender.Size = New Size(sender.Width + e.X - p1.X, sender.Height) p1 = New Point(e.X, e.Y) Case EnumMousePointPosition.MouseSizeTop sender.Location = New Point(sender.Left, sender.Top + (e.Y - p.Y)) sender.Size = New Size(sender.Width, sender.Height - (e.Y - p.Y)) Case EnumMousePointPosition.MouseSizeLeft sender.Location = New Point(sender.Left + e.X - p.X, sender.Top) sender.Size = New Size(sender.Width - (e.X - p.X), sender.Height) Case EnumMousePointPosition.MouseSizeBottomLeft sender.Location = New Point(sender.Left + e.X - p.X, sender.Top) sender.Size = New Size(sender.Width - (e.X - p.X), sender.Height + e.Y - p1.Y) Case EnumMousePointPosition.MouseSizeTopRight sender.Location = New Point(sender.Left, sender.Top + (e.Y - p.Y)) sender.Size = New Size(sender.Width + (e.X - p1.X), sender.Height - (e.Y - p.Y)) Case EnumMousePointPosition.MouseSizeTopLeft sender.Location = New Point(sender.Left + e.X - p.X, sender.Top + (e.Y - p.Y)) sender.Size = New Size(sender.Width - (e.X - p.X), sender.Height - (e.Y - p.Y)) End Select Else m_MousePointPosition = MousePointPosition(sender.Size, e) '判断光标的位置状态 Select Case m_MousePointPosition '改变光标 Case EnumMousePointPosition.MouseSizeNone Me.Cursor = Cursors.Arrow '箭头 Case EnumMousePointPosition.MouseDrag Me.Cursor = Cursors.SizeAll '四方向 Case EnumMousePointPosition.MouseSizeBottom Me.Cursor = Cursors.SizeNS '南北 Case EnumMousePointPosition.MouseSizeTop Me.Cursor = Cursors.SizeNS '南北 Case EnumMousePointPosition.MouseSizeLeft Me.Cursor = Cursors.SizeWE '东西 Case EnumMousePointPosition.MouseSizeRight
|
正在阅读:编程必学:控件的拖动和缩放技术全解编程必学:控件的拖动和缩放技术全解
2004-12-09 10:11
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键