询问者
有关于 ScrollableControl ,滚动问题,在以下代码中无法判断scrollbar 所在的 point

问题
-
Code SnippetCode Snippet
Imports System.Runtime.InteropServices
Imports System.ComponentModelPublic Class ScrollableControl
Inherits ControlCode Snippet' Fields
Private mBorderStyle As BorderStyleEnum
Private mScrollBars As ScrollBars
Private mHorizontal As Boolean
Private mVertical As Boolean
Private mScrollTips As ToolTip
Private mCursor As Cursor
Private mScrollPosition As Point
Private mScrollSize As Size
Private mClientSize As Size
Private mSmallChange As Size
Private mScrollTrack As Boolean
Private mblnRedrawInternal As Boolean
Private mUseScrollWindow As Boolean
Private mSizeChanged As Boolean' Methods
Public Sub New()
MyBase.SetStyle(ControlStyles.Selectable, True)
MyBase.SetStyle(ControlStyles.AllPaintingInWmPaint, True)
MyBase.SetStyle(ControlStyles.UserPaint, True)
MyBase.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
MyBase.SetStyle(ControlStyles.ResizeRedraw, True)
MyBase.SetStyle(&H20000, True)
Me.mblnRedrawInternal = True
Me.mScrollTrack = True
Me.mScrollPosition = New Point(0, 0)
Me.mScrollSize = New Size(0, 0)
Me.mSmallChange = New Size(10, 10)
Me.mCursor = Cursors.Default
Me.mUseScrollWindow = False
Me.BorderStyle = BorderStyleEnum.Fixed3D
Me.ScrollBars = ScrollBars.Both
End SubProtected Overridable Function BuildScrollableRectangle(ByVal dx As Integer, ByVal dy As Integer) As Rectangle
Return Me.ScrollableRectangle
End FunctionProtected Overrides Sub Dispose(ByVal disposing As Boolean)
If (Not Me.mScrollTips Is Nothing) Then
Me.mScrollTips.AutomaticDelay = 0
Me.mScrollTips.RemoveAll()
Me.mScrollTips.Dispose()
Me.mScrollTips = Nothing
End If
'If (Not Me.o Is Nothing) Then
' Me.o.d()
' Me.o = Nothing
'End If
MyBase.Dispose(disposing)
End SubPrivate Function SetScrollbarPos(ByVal A_0 As Integer, ByVal A_1 As Integer) As Integer
Return scrollbar.SetScrollbarPos(MyBase.Handle, A_0, A_1)
End FunctionPrivate Function GetScrollTrackPos(ByVal A_0 As Integer) As Integer
Return scrollbar.GetScrollTrackPos(MyBase.Handle, A_0)
End FunctionPrivate Function GetScrollbarPos(ByVal A_0 As Integer) As Integer
Return scrollbar.GetScrollbarPos(MyBase.Handle, A_0)
End FunctionPrivate Function GetScrollDifference(ByVal A_0 As Integer) As Integer
Return scrollbar.GetScrollDifference(MyBase.Handle, A_0)
End FunctionPrivate Sub SetScroll(ByVal A_0 As Point)
If Not Me.mblnRedrawInternal Then
Me.mScrollPosition = A_0
Else
Me.SetScrollbarPos(0, -A_0.X)
Me.SetScrollbarPos(1, -A_0.Y)
Me.mScrollPosition = A_0
Dim num As Integer = Me.GetScrollbarPos(0)
Dim num2 As Integer = Me.GetScrollbarPos(1)
If Not Me.mHorizontal Then
num = Math.Min(-A_0.X, (Me.mScrollSize.Width - MyBase.ClientSize.Width))
If (num < 0) Then
num = 0
End If
End If
If Not Me.mVertical Then
num2 = Math.Min(-A_0.Y, (Me.mScrollSize.Height - MyBase.ClientSize.Height))
If (num2 < 0) Then
num2 = 0
End If
End If
Dim point As New Point(-num, -num2)
If (point <> Me.mScrollPosition) Then
Dim dx As Integer = (point.X - Me.mScrollPosition.X)
Dim dy As Integer = (point.Y - Me.mScrollPosition.Y)
Dim rt As scrollbar.RECT = scrollbar.RECT.CRectangle(Rectangle.Empty)
If (Me.mUseScrollWindow AndAlso (Me.BackgroundImage Is Nothing)) Then
rt = scrollbar.RECT.CRectangle(Me.BuildScrollableRectangle(dx, dy))
End If
If (rt.Width > 0) Then
MyBase.Update()
End If
Me.mScrollPosition = point
If (dx <> 0) Then
Me.OnScroll(ScrollBars.Horizontal)
End If
If (dy <> 0) Then
Me.OnScroll(ScrollBars.Vertical)
End If
If (rt.Width > 0) Then
scrollbar.ScrollWindow(MyBase.Handle, (rt), dx, dy)
Else
MyBase.Invalidate()
End If
End If
End If
End SubPrivate Function SetScrollbar(ByVal A_0 As Integer, ByVal A_1 As Integer, ByVal A_2 As Integer) As Integer
If (Not Me.mHorizontal AndAlso (A_0 = 0)) Then
A_1 = 0
End If
If (Not Me.mVertical AndAlso (A_0 = 1)) Then
A_1 = 0
End If
Return scrollbar.SetScrollbar(MyBase.Handle, A_0, A_1, A_2)
End FunctionPrivate Sub PostMessage(ByVal A_0 As Message)
Dim intNum As Integer = 0
Dim intWidth As Integer = 0
Dim intHeight As Integer = 0
Select Case A_0.Msg
Case &H114
intNum = 0
intwidth = Me.mSmallChange.Width
intHeight = Me.ScrollableRectangle.Width
Exit Select
Case &H115
intNum = 1
intwidth = Me.mSmallChange.Height
intHeight = Me.ScrollableRectangle.Height
Exit Select
Case Else
Throw New Exception("Unexpected message in scroll routine")
End Select
Dim newValue As Integer = Me.GetScrollTrackPos(intNum)
Select Case (A_0.WParam.ToInt32 And &HFFFF)
Case 0
newValue = (newValue - width)
Exit Select
Case 1
newValue = (newValue + width)
Exit Select
Case 2
newValue = (newValue - height)
Exit Select
Case 3
newValue = (newValue + height)
Exit Select
Case 4
newValue = Me.GetScrollTrackPos(intNum)
Exit Select
Case 5
newValue = Me.GetScrollTrackPos(intNum)
If (((A_0.Msg = &H115) AndAlso (Not Me.mScrollTips Is Nothing)) AndAlso Me.mScrollTips.Active) Then
Me.mScrollTips.InitialDelay = 30
Me.mScrollTips.ReshowDelay = &H7530
Me.OnScrollTip(newValue)
End If
If Not Me.mScrollTrack Then
Return
End If
Exit Select
Case 6
newValue = 0
Exit Select
Case 7
newValue = &H7FFFFFFF
Exit Select
Case 8
If ((Not Me.mScrollTips Is Nothing) AndAlso Me.mScrollTips.Active) Then
Me.mScrollTips.InitialDelay = &H7530
Me.mScrollTips.Active = False
Me.mScrollTips.Active = True
End If
Exit Select
End Select
If (newValue <> Me.GetScrollbarPos(intNum)) Then
Me.SetScrollbarPos(intNum, newValue)
Dim g As Point = Me.mScrollPosition
If Me.mHorizontal Then
g.X = -Me.GetScrollbarPos(0)
End If
If Me.mVertical Then
g.Y = -Me.GetScrollbarPos(1)
End If
'Me.ScrollPosition = g
End If
End SubProtected Overridable Sub OnImeStartComposition()
End SubProtected Overrides Sub OnMouseWheel(ByVal e As System.Windows.Forms.MouseEventArgs)
Dim num As Integer = (e.Delta / 120)
num = (num * SystemInformation.MouseWheelScrollLines)
If ((Control.ModifierKeys And Keys.Shift) <> Keys.None) Then
num = (num * 10)
End If
Dim ptSc As Point = Me.ScrollPosition
If ((Control.ModifierKeys And Keys.Control) <> Keys.None) Then
ptSc.X = (ptSc.X + (num * Me.mSmallChange.Width))
Else
ptSc.Y = (ptSc.Y + (num * Me.mSmallChange.Height))
End If
Me.ScrollPosition = ptSc
End SubProtected Overridable Sub OnScroll(ByVal sb As ScrollBars)
MyBase.Invalidate()
End SubProtected Overridable Sub OnScrollTip(ByVal newValue As Integer)
End SubProtected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
If Not Me.mSizeChanged Then
Me.SetScrollSize(Me.mScrollSize)
MyBase.OnSizeChanged(e)
End If
End SubFriend Sub SetScrollSize(ByVal A_0 As Size)
If Not Me.mblnRedrawInternal Then
Me.mScrollSize = A_0
ElseIf (((A_0 <> Me.mScrollSize) OrElse (MyBase.ClientSize <> Me.mClientSize)) AndAlso Not Me.mSizeChanged) Then
Me.mSizeChanged = True
Me.SetScrollbar(1, 0, 0)
Me.SetScrollbar(0, 0, 0)
Dim cs As Size = MyBase.ClientSize
Dim i As Integer
For i = 0 To 5 - 1
Me.SetScrollbar(0, A_0.Width, (cs.Width + 1))
Me.SetScrollbar(1, A_0.Height, (cs.Height + 1))
If (cs = MyBase.ClientSize) Then
Exit For
End If
cs = MyBase.ClientSize
Next i
Me.mScrollSize = A_0
Me.mClientSize = MyBase.ClientSize
Me.SetScroll(Me.mScrollPosition)
Me.mSizeChanged = False
End If
End SubProtected Overrides Sub SetClientSizeCore(ByVal x As Integer, ByVal y As Integer)
If (Me.mScrollSize.Width > x) Then
y = (y + SystemInformation.HorizontalScrollBarHeight)
End If
If (Me.mScrollSize.Height > y) Then
x = (x + SystemInformation.VerticalScrollBarWidth)
End If
MyBase.SetClientSizeCore(x, y)
End Sub'Protected Overrides Sub WndProc(ByRef m As Message)
' Dim msg As Integer = m.Msg
' Select Case msg
' Case &H114, &H115
' 'Me.PostMessage(m)
' 'Return
' Case &H10D
' Me.OnImeStartComposition()
' Exit Select
' Case Else
' If (msg = &H31A) Then
' 'Me.o.d()
' End If
' Exit Select
' End Select
' MyBase.WndProc((m))
'End SubProtected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Dim msg1 As Integer = m.Msg
Select Case msg1
Case &H114, &H115
Me.PostMessage(m)
Return
Case &H10D
Me.OnImeStartComposition()
Case Else
End Select
MyBase.WndProc(m)
End Sub' Properties
Public Property BorderStyle() As BorderStyleEnum
Get
Return Me.mBorderStyle
End Get
Set(ByVal value As BorderStyleEnum)
If (Me.mBorderStyle <> value) Then
Me.mBorderStyle = value
MyBase.UpdateStyles()
End If
End Set
End PropertyProtected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim c As CreateParams = MyBase.CreateParams
c.Style = (c.Style Or &H6000000)
Select Case Me.mBorderStyle
Case BorderStyleEnum.FixedSingle
c.Style = (c.Style Or &H800000)
Return c
Case BorderStyleEnum.Fixed3D
c.ExStyle = (c.ExStyle Or &H200)
Return c
Case BorderStyleEnum.Light3D
c.ExStyle = (c.ExStyle Or &H20000)
Return c
End Select
Return c
End Get
End PropertyPublic Overrides Property Cursor() As Cursor
Get
Return MyBase.Cursor
End Get
Set(ByVal value As Cursor)
Me.mCursor = value
If (Not value Is MyBase.Cursor) Then
MyBase.Cursor = value
End If
End Set
End PropertyFriend Property CursorInternal() As Cursor
Get
Return MyBase.Cursor
End Get
Set(ByVal A_0 As Cursor)
If (A_0 Is Nothing) Then
A_0 = Me.mCursor
End If
If (Not A_0 Is MyBase.Cursor) Then
MyBase.Cursor = A_0
End If
End Set
End PropertyFriend Property RedrawInternal() As Boolean
Get
Return Me.mblnRedrawInternal
End Get
Set(ByVal A_0 As Boolean)
If (Me.mblnRedrawInternal <> A_0) Then
Me.mblnRedrawInternal = A_0
If Me.mblnRedrawInternal Then
Me.SetScrollSize(Me.mScrollSize)
Me.ScrollPosition = Me.mScrollPosition
MyBase.Invalidate()
End If
End If
End Set
End PropertyPublic Overridable ReadOnly Property ScrollableRectangle() As Rectangle
Get
Return MyBase.ClientRectangle
End Get
End PropertyPublic Property ScrollBars() As ScrollBars
Get
Return Me.mScrollBars
End Get
Set(ByVal value As ScrollBars)
Me.mScrollBars = value
Me.mHorizontal = ((Me.mScrollBars = ScrollBars.Horizontal) OrElse (Me.mScrollBars = ScrollBars.Both))
Me.mVertical = ((Me.mScrollBars = ScrollBars.Vertical) OrElse (Me.mScrollBars = ScrollBars.Both))
Dim h As Size = Me.mScrollSize
Me.mScrollSize = Drawing.Size.Empty
Me.SetScrollSize(h)
MyBase.Invalidate()
End Set
End PropertyPublic Property ScrollPosition() As Point
Get
Return Me.mScrollPosition
End Get
Set(ByVal value As Point)
Me.SetScroll(value)
End Set
End PropertyFriend Property ScrollSize() As Size
Get
Return Me.mScrollSize
End Get
Set(ByVal A_0 As Size)
If Not Me.mblnRedrawInternal Then
Me.mScrollSize = A_0
ElseIf (((A_0 <> Me.mScrollSize) OrElse (MyBase.ClientSize <> Me.mClientSize)) AndAlso Not Me.mSizeChanged) Then
Me.mSizeChanged = True
Me.SetScrollbar(1, 0, 0)
Me.SetScrollbar(0, 0, 0)
Dim clientSize As Size = MyBase.ClientSize
Dim i As Integer
For i = 0 To 5 - 1
Me.SetScrollbar(0, A_0.Width, (clientSize.Width + 1))
Me.SetScrollbar(1, A_0.Height, (clientSize.Height + 1))
If (clientSize = MyBase.ClientSize) Then
Exit For
End If
clientSize = MyBase.ClientSize
Next i
Me.mScrollSize = A_0
Me.mClientSize = MyBase.ClientSize
Me.mScrollPosition = New Point(A_0.Width, A_0.Height)
Me.SetScroll(Me.mScrollPosition)
Me.mSizeChanged = False
End If
End Set
End PropertyPublic Property ScrollTips() As Boolean
Get
Return ((Not Me.mScrollTips Is Nothing) AndAlso Me.mScrollTips.Active)
End Get
Set(ByVal value As Boolean)
If (value <> Me.ScrollTips) Then
If ((Me.mScrollTips Is Nothing) AndAlso value) Then
Try
Me.mScrollTips = New ToolTip
Me.mScrollTips.ShowAlways = False
Me.mScrollTips.Active = value
Me.mScrollTips.SetToolTip(Me, " ")
Me.mScrollTips.InitialDelay = &H7530
Catch obj1 As Exception
End Try
ElseIf (Not Me.mScrollTips Is Nothing) Then
Me.mScrollTips.Active = value
End If
End If
End Set
End PropertyPublic Property ScrollTipText() As String
Get
If (Me.mScrollTips Is Nothing) Then
Return ""
End If
Return Me.mScrollTips.GetToolTip(Me)
End Get
Set(ByVal value As String)
If ((value <> Me.ScrollTipText) AndAlso (Not Me.mScrollTips Is Nothing)) Then
Me.mScrollTips.SetToolTip(Me, value)
End If
End Set
End PropertyPublic Property ScrollTrack() As Boolean
Get
Return Me.mScrollTrack
End Get
Set(ByVal value As Boolean)
Me.mScrollTrack = value
End Set
End PropertyFriend Property SmallChange() As Size
Get
Return Me.mSmallChange
End Get
Set(ByVal A_0 As Size)
Me.mSmallChange = A_0
End Set
End Property_
Friend Property UseScrollWindow() As Boolean
Get
Return Me.mUseScrollWindow
End Get
Set(ByVal A_0 As Boolean)
Me.mUseScrollWindow = A_0
End Set
End PropertyPublic Enum BorderStyleEnum
' Fields
Fixed3D = 2
FixedSingle = 1
Light3D = 3
None = 0
End Enum
'Private o As b
End ClassFriend Class scrollbar
Public Enum ScrollInfoMask
SIF_RANGE = 1
SIF_PAGE = 2
SIF_POS = 4
SIF_DISABLENOSCROLL = 8
SIF_TRACKPOS = 16
SIF_ALL = SIF_RANGE + SIF_PAGE + SIF_POS + SIF_DISABLENOSCROLL + SIF_TRACKPOS
End Enum' Methods
Friend Shared Function SetScrollbar(ByVal A_0 As IntPtr, ByVal A_1 As Integer, ByVal A_2 As Integer, ByVal A_3 As Integer) As Integer
Dim a1 As New SCROLLINFO(3)
Dim intReturn As Integer
a1.nMax = A_2
a1.nPage = DirectCast(A_3, Integer)
intReturn = scrollbar.SetScrollInfo(A_0, A_1, (a1), 1)
Debug.Print(GetLastError())
Return intReturn
End Function'Friend Shared Sub b(ByVal A_0 As Graphics, ByVal A_1 As Rectangle, ByVal A_2 As Border3DStyle)
' Dim control As Pen = SystemPens.Control
' Dim controlLightLight As Pen = SystemPens.ControlLightLight
' Dim controlDark As Pen = SystemPens.ControlDark
' Dim controlDarkDark As Pen = SystemPens.ControlDarkDark
' A_1.Width -= 1
' A_1.Height -= 1
' Select Case A_2
' Case Border3DStyle.RaisedOuter
' scrollbar.h(A_0, A_1, control)
' scrollbar.g(A_0, A_1, controlDarkDark)
' Return
' Case Border3DStyle.SunkenOuter
' scrollbar.h(A_0, A_1, controlDark)
' scrollbar.g(A_0, A_1, controlLightLight)
' Return
' Case Border3DStyle.RaisedInner
' scrollbar.h(A_0, A_1, controlLightLight)
' scrollbar.g(A_0, A_1, controlDark)
' Return
' Case Border3DStyle.Raised
' scrollbar.h(A_0, A_1, control)
' scrollbar.g(A_0, A_1, controlDarkDark)
' A_1.Inflate(-1, -1)
' scrollbar.h(A_0, A_1, controlLightLight)
' scrollbar.g(A_0, A_1, controlDark)
' Return
' Case Border3DStyle.Etched
' scrollbar.h(A_0, A_1, controlDark)
' scrollbar.g(A_0, A_1, controlLightLight)
' A_1.Inflate(-1, -1)
' scrollbar.h(A_0, A_1, controlLightLight)
' scrollbar.g(A_0, A_1, controlDark)
' Return
' Case Border3DStyle.SunkenInner
' scrollbar.h(A_0, A_1, controlDarkDark)
' scrollbar.g(A_0, A_1, control)
' Return
' Case Border3DStyle.Bump
' scrollbar.h(A_0, A_1, control)
' scrollbar.g(A_0, A_1, controlDarkDark)
' A_1.Inflate(-1, -1)
' scrollbar.h(A_0, A_1, controlDarkDark)
' scrollbar.g(A_0, A_1, control)
' Return
' Case Border3DStyle.Sunken
' scrollbar.h(A_0, A_1, controlDark)
' scrollbar.g(A_0, A_1, controlLightLight)
' A_1.Inflate(-1, -1)
' scrollbar.h(A_0, A_1, controlDarkDark)
' scrollbar.g(A_0, A_1, control)
' Return
' Case Border3DStyle.Adjust, Border3DStyle.Flat
' A_0.DrawRectangle(controlDark, A_1)
' A_1.Inflate(-1, -1)
' A_0.DrawRectangle(control, A_1)
' Return
' End Select
' Throw New Exception("Unsupported BorderStyle.")
'End SubFriend Shared Function GetScrollDifference(ByVal A_0 As IntPtr, ByVal A_1 As Integer) As Integer
Dim a As New SCROLLINFO(1)
scrollbar.GetScrollInfo(A_0, A_1, (a))
Return (a.nMax - a.nMin)
End FunctionFriend Shared Function GetScrollbarPos(ByVal A_0 As IntPtr, ByVal A_1 As Integer) As Integer
Dim a As New SCROLLINFO(20) '20
a.cbSize = Marshal.SizeOf(a)
a.fMask = &H10
scrollbar.GetScrollInfo(A_0, 2, (a))
Debug.Print(GetLastError())
Return a.nPos
End Function
Friend Shared Function GetScrollTrackPos(ByVal A_0 As IntPtr, ByVal A_1 As Integer) As Integer
Dim a As New SCROLLINFO(20) '20
scrollbar.GetScrollInfo(A_0, A_1, (a))
Return a.nTrackPos
'Dim si As New SCROLLINFO(20)
'si.fMask = &H10
'GetScrollInfo(A_0, A_1, si)
'Return si.nTrackPos
End FunctionFriend Shared Function f(ByVal A_0 As Point) As IntPtr
Return CType((A_0.X Or (A_0.Y << &H10)), IntPtr)
End Function' _
'Private Shared Function GetScrollInfo(ByVal hWnd As IntPtr, ByVal fnBar As Integer, ByRef lpsi As SCROLLINFO) As Integer
'End Function' _
'Private Shared Function GetScrollInfo(ByVal A_0 As IntPtr, ByVal A_1 As Integer, ByRef A_2 As SCROLLINFO) As Integer 'boolean
'End Function
_
Public Shared Function GetLastError() As Int32
End Function' _
'Public Shared Function GetScrollInfo(ByVal hWnd As IntPtr, ByVal fnBar As Integer, ByRef si As SCROLLINFO) As Boolean
'End Function_
Public Shared Function GetScrollInfo(ByVal hWnd As IntPtr, ByVal fnBar As Integer, ByRef lpsi As SCROLLINFO) As Integer
End FunctionFriend Shared Function ScrollWindow(ByVal A_0 As IntPtr, ByRef A_1 As RECT, ByVal A_2 As Integer, ByVal A_3 As Integer, ByVal A_4 As Boolean) As Integer
Dim num As UInt32 = IIf(A_4, 3, 2)
Return scrollbar.ScrollWindowEx(A_0, A_2, A_3, (A_1), (A_1), IntPtr.Zero, IntPtr.Zero, num)
End FunctionFriend Shared Function ScrollWindow(ByVal A_0 As IntPtr, ByRef A_1 As RECT, ByVal A_2 As Integer, ByVal A_3 As Integer) As Integer
Return scrollbar.ScrollWindow(A_0, (A_1), A_2, A_3, True)
End FunctionFriend Shared Function SetScrollbarPos(ByVal A_0 As IntPtr, ByVal A_1 As Integer, ByVal A_2 As Integer) As Integer
Dim a As New SCROLLINFO(4)
a.nPos = A_2
Return scrollbar.SetScrollInfo(A_0, A_1, (a), 1)
End Function_
Private Shared Function ScrollWindowEx(ByVal A_0 As IntPtr, ByVal A_1 As Integer, ByVal A_2 As Integer, ByRef A_3 As RECT, ByRef A_4 As RECT, ByVal A_5 As IntPtr, ByVal A_6 As IntPtr, ByVal A_7 As UInt32) As Integer
End Function_
Private Shared Function SetScrollInfo(ByVal A_0 As IntPtr, ByVal A_1 As Integer, ByRef A_2 As SCROLLINFO, ByVal A_3 As Integer) As Integer
End Function' Fields
Friend Const a1 As Integer = &H800000
Friend Const aa As Integer = 120
Friend Const ab As Integer = 0
Friend Const ac As Integer = 1
Friend Const ad As Integer = 2
Friend Const ae As Integer = 3
Friend Const af As Integer = 0
Friend Const ag As Integer = 1
Friend Const ah As Integer = 2
Friend Const ai As Integer = 3
Friend Const aj As Integer = 4
Friend Const ak As Integer = 5
Friend Const al As Integer = 6
Friend Const am As Integer = 7
Friend Const an As Integer = 8
Friend Const ao As Integer = 1
Friend Const ap As Integer = 2
Friend Const aq As Integer = 4
Friend Const ar As Integer = 8
Friend Const [as] As Integer = &H10
Friend Const at As Integer = &H17
Friend Const au As Integer = 1
Friend Const av As Integer = 2
Friend Const aw As Integer = 4
Friend Const ax As Integer = &H10
Friend Const b1 As Integer = &H200000
Friend Const c1 As Integer = &H100000
Friend Const d1 As Integer = &H4000000
Friend Const e1 As Integer = &H2000000
Friend Const f1 As Integer = &H20000
Friend Const g1 As Integer = &H200
Friend Const h1 As Integer = &H400000
Friend Const i1 As Integer = &H4000
Friend Const j1 As Integer = &H100000
Friend Const k1 As Integer = 20
Friend Const l As Integer = &H100
Friend Const m As Integer = &H101
Friend Const n As Integer = &H102
Friend Const o As Integer = &H201
Friend Const p As Integer = &H202
Friend Const q As Integer = &H114
Friend Const r As Integer = &H115
Friend Const s As Integer = &H20A
Friend Const t As Integer = &H31A
Friend Const u As Integer = &H10D
Friend Const v As Integer = &HD7
Friend Const w As Integer = &HC9
Friend Const x As Integer = &HBA
Friend Const y As Integer = &HB2
Friend Const z As Integer = &HB3' Nested Types
_
Friend Structure SCROLLINFO
Friend cbSize As UInt32 'a
Friend fMask As UInt32 'b
Friend nMin As Integer 'c
Friend nMax As Integer 'd
Friend nPage As UInt32 'e
Friend nPos As Integer 'f
Friend nTrackPos As Integer 'g'UINT cbSize; //sizeof(SCROLLINFO)
'UINT fMask; //参数选项
'int nMin; //滚动条范围最小值
'int nMax; //滚动条范围最大值
'UINT nPage; //页面大小
'int nPos; //滚动框当前位置
'int nTrackPos; //si.cbMask设置为SIF_TRACKPOS,滚动框当前位置Friend Sub New(ByVal A_0 As UInt32)
Me.cbSize = Marshal.SizeOf(GetType(SCROLLINFO))
Me.fMask = A_0
Me.nMin = 0
Me.nMax = 0
Me.nPos = 0
Me.nTrackPos = 0
Me.nPage = 0
End Sub
End Structure_
Friend Structure RECT
Friend X As Integer 'a
Friend Y As Integer 'b
Friend Right As Integer 'c
Friend Bottom As Integer 'dFriend Sub New(ByVal A_0 As Rectangle)
Me.X = A_0.X
Me.Y = A_0.Y
Me.Right = A_0.Right
Me.Bottom = A_0.Bottom
End SubFriend Function Height() As Integer
Return (Me.Bottom - Me.Y)
End FunctionFriend Function Width() As Integer
Return (Me.Right - Me.X)
End FunctionFriend Sub New(ByVal A_0 As Integer, ByVal A_1 As Integer)
Me.X = (Me.X + A_0)
Me.Y = (Me.Y + A_0)
Me.Right = (Me.Right + A_1)
Me.Bottom = (Me.Bottom + A_1)
End SubPublic Shared Function a(ByVal A_0 As RECT) As Rectangle
Return New Rectangle(A_0.X, A_0.Y, A_0.Y, A_0.Right)
End FunctionPublic Shared Function CRectangle(ByVal A_0 As Rectangle) As RECT
Return New RECT(A_0)
End Function
End Structure
End Class