1,451
社区成员
发帖
与我相关
我的任务
分享
If Table(1).TD(nSetX).vType = CheckType Then
If IsNumeric(PrintCaption) = True Then
If Int(PrintCaption) = 1 Then
PrintCaption = 1
Else
PrintCaption = 0
End If
Else
PrintCaption = 0
End If
TmpRect.Left = DRect.Left + ((DRect.Right - DRect.Left) / 2 - Check1.Width / 2)
TmpRect.Top = DRect.Top + ((DRect.Bottom - DRect.Top) / 2 - Check1.Height / 2)
TmpRect.Right = TmpRect.Left + Check1.Width
TmpRect.Bottom = TmpRect.Top + Check1.Height
If Int(PrintCaption) = 0 Then
DrawFrameControl GDI.hdc, TmpRect, DFC_BUTTON, DFCS_BUTTONCHECK
Else
DrawFrameControl GDI.hdc, TmpRect, DFC_BUTTON, DFCS_CHECKED
End If
Else
DRect.Left = DRect.Left + 3
DRect.Top = DRect.Top + 2
DRect.Right = DRect.Right - 3
DRect.Bottom = DRect.Bottom - 2
Select Case Table(1).TD(nSetX).Alignment
Case 0: DrawText GDI.hdc, PrintCaption, LenB(StrConv(PrintCaption, vbFromUnicode)), DRect, DT_VCENTER Or DT_SINGLELINE
Case 1: DrawText GDI.hdc, PrintCaption, LenB(StrConv(PrintCaption, vbFromUnicode)), DRect, DT_RIGHT Or DT_VCENTER Or DT_SINGLELINE
Case 2: DrawText GDI.hdc, PrintCaption, LenB(StrConv(PrintCaption, vbFromUnicode)), DRect, DT_CENTER Or DT_VCENTER Or DT_SINGLELINE
End Select
End If
End If
NextX:
Next X
Next Y
Dim LeftX As Long
Dim RightX As Long
Dim TopY As Long
Dim BottomY As Long
If IsMouseSelect = True Then
If MovX < MovOverX Then
LeftX = MovX
RightX = MovOverX
Else
LeftX = MovOverX
RightX = MovX
End If
If MovY < MovOverY Then
TopY = MovY
BottomY = MovOverY
Else
TopY = MovOverY
BottomY = MovY
End If
sCoolWidth = RightX - LeftX
sCoolHeight = BottomY - TopY
CollRes.DrawLine 0, 0, sCoolWidth, sCoolHeight, m_TableColor, m_BackColor, LineTypeBf
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = 60
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, LeftX, TopY, sCoolWidth + 1, sCoolHeight + 1, CollRes.hdc, 0, 0, sCoolWidth, sCoolHeight, lBF
GDI.DrawLine LeftX, TopY, RightX, BottomY, m_TableColor, m_BackColor, LineTypeB
End If
BitBlt UserControl.hdc, 0, 0, DBGridWidth, DBGridHeight, GDI.hdc, 0, 0, vbSrcCopy
If IsEdit = True Then
If FocusRect.Left = 0 And FocusRect.Top = 0 And FocusRect.Right = 0 And FocusRect.Bottom Then
GoTo HideEdit
End If
If EditRow > memVScrollValue And EditRow <= memVScrollValue + ForData Then
RectW = FocusRect.Right - FocusRect.Left
RectH = FocusRect.Bottom - FocusRect.Top
Select Case EditType
Case DateTimeType:
If FocusRect.Left + RectW > 0 And FocusRect.Left < DBGridWidth Then
TimeText1.Move FocusRect.Left, FocusRect.Top + Int(RectH / 2 - Check1.Height / 2) - 1, RectW
TimeText1.Visible = False
TimeText1.Visible = True
TimeText1.SetFocus
Else
TimeText1.Visible = False
End If
Case CheckType:
If FocusRect.Left + Int(RectW / 2 - Check1.Width / 2) + 1 + Check1.Width > 0 And FocusRect.Left + Int(RectW / 2 - Check1.Width / 2) + 1 < DBGridWidth Then
Check1.Move FocusRect.Left + Int(RectW / 2 - Check1.Width / 2) + 1, FocusRect.Top + Int(RectH / 2 - Check1.Height / 2) + 1
Check1.Visible = False
Check1.Visible = True
Check1.SetFocus
Else
Check1.Visible = False
End If
Case ComboType:
If FocusRect.Left + RectW > 0 And FocusRect.Left < DBGridWidth Then
Combo1.Move FocusRect.Left, FocusRect.Top + Int(RectH / 2 - Check1.Height / 2) - 1, RectW
Combo1.Visible = False
Combo1.Visible = True
Else
Combo1.Visible = False
End If
Case ComboTextType:
If FocusRect.Left + RectW > 0 And FocusRect.Left < DBGridWidth Then
Combo2.Move FocusRect.Left, FocusRect.Top + Int(RectH / 2 - Check1.Height / 2) - 1, RectW
Combo2.Visible = False
Combo2.Visible = True
Combo2.SetFocus
Else
Combo2.Visible = False
End If
Case TextCoLfType:
If FocusRect.Left + RectW > 0 And FocusRect.Left + 1 < DBGridWidth Then
Text2.Move FocusRect.Left + 1, FocusRect.Top + 1, RectW - 1, RectH - 1
Text2.Visible = False
Text2.Visible = True
Text2.SetFocus
Else
Text2.Visible = False
End If
Case TextType:
If FocusRect.Left + RectW > 0 And FocusRect.Left + 1 < DBGridWidth Then
Text1.Move FocusRect.Left + 1, FocusRect.Top + 1, RectW - 1, RectH - 1
Text1.Visible = False
Text1.Visible = True
Text1.SetFocus
Else
Text1.Visible = False
End If
Case NumericType:
If (FocusRect.Left + RectW) > 0 And (FocusRect.Left + 1) < DBGridWidth Then
Text1.Move FocusRect.Left + 1, FocusRect.Top + 1, RectW - 1, RectH - 1
Text1.Visible = False
Text1.Visible = True
Text1.SetFocus
Else
Text1.Visible = False
End If
Case TextButton
If (FocusRect.Left + 1) + (RectW - 1 - TRHeight) > 0 And FocusRect.Left + 1 < DBGridWidth Then
Text1.Move FocusRect.Left + 1, FocusRect.Top + 1, RectW - 1 - TRHeight, RectH - 1
Text1.Visible = False
Text1.Visible = True
Text1.SetFocus
Else
Text1.Visible = False
End If
If (Text1.Left + Text1.Width) + TRHeight > 0 And (Text1.Left + Text1.Width) < DBGridWidth Then
Command1.Move Text1.Left + Text1.Width, Text1.Top, TRHeight, Text1.Height
Command1.Visible = False
Command1.Visible = True
Else
Command1.Visible = False
End If
End Select
Else
HideEdit:
Select Case EditType
Case DateTimeType:
TimeText1.Visible = False
Case CheckType:
Check1.Visible = False
Case ComboType:
Combo1.Visible = False
Case ComboTextType:
Combo2.Visible = False
Case TextCoLfType:
Text2.Visible = False
Case TextType:
Text1.Visible = False
Case NumericType:
Text1.Visible = False
Case TextButton
Text1.Visible = False
Command1.Visible = False
End Select
End If
End If
End Sub
Else
ButtonRECT(ButtonCount).Left = DRect.Left
ButtonRECT(ButtonCount).Top = DRect.Top
ButtonRECT(ButtonCount).Right = DRect.Right
ButtonRECT(ButtonCount).Bottom = DRect.Bottom
If Table(Y + memVScrollValue).TD(X).IsRUnite = True Then
ButtonRECT(ButtonCount).Y = PrintY
nSetY = PrintY
Else
ButtonRECT(ButtonCount).Y = Y + memVScrollValue
nSetY = Y + memVScrollValue
End If
If Table(Y + memVScrollValue).TD(X).IsCUnite = True Then
ButtonRECT(ButtonCount).X = PrintX
nSetX = PrintX
Else
ButtonRECT(ButtonCount).X = X
nSetX = X
End If
If Table(nSetY).IsSelect = True Then
Select Case Table(1).TD(nSetX).Style
Case 0
sCoolWidth = DRect.Right - DRect.Left
sCoolHeight = DRect.Bottom - DRect.Top
CollRes.DrawLine 0, 0, sCoolWidth, sCoolHeight, m_TableColor, m_BackColorSelect, LineTypeBf
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = CollAlpha
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, sCoolWidth, sCoolHeight, CollRes.hdc, 0, 0, sCoolWidth, sCoolHeight, lBF
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Bottom - 1, m_HeadShadowColor, , LineTypeB
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Top, m_HeadBrightColor
GDI.DrawLine DRect.Left, DRect.Top, DRect.Left, DRect.Bottom - 1, m_HeadBrightColor
'GDI.DrawLine DRect.Left, DRect.Top, DRect.Right + 1, DRect.Bottom + 1,m_TableColor, m_BackColorSelect, LineTypeBF
If SelRow = nSetY Then
If SelCol = nSetX Then
FocusRect.Left = DRect.Left
FocusRect.Top = DRect.Top
FocusRect.Right = DRect.Right
FocusRect.Bottom = DRect.Bottom
DFRect.Left = DRect.Left + 2
DFRect.Top = DRect.Top + 2
DFRect.Right = DRect.Right - 1
DFRect.Bottom = DRect.Bottom - 1
'GDI.DrawLine DFRect.Left, DFRect.Top, DFRect.Right, DFRect.Bottom,m_BackColorSelect ,, LineTypeB, 2
DrawFocusRect GDI.hdc, DFRect
End If
End If
GDI.ForeColor = m_ForeColorSelect
Case 1
If HadePic = True Then
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = 255
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, lBF
'StretchBlt GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, vbSrcCopy
Else
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right, DRect.Bottom, m_TableColor, m_HeadBackColor, LineTypeBf
End If
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Bottom - 1, m_HeadShadowColor, , LineTypeB
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Top, m_HeadBrightColor
GDI.DrawLine DRect.Left, DRect.Top, DRect.Left, DRect.Bottom - 1, m_HeadBrightColor
SelectObject GDI.hdc, TableBrush
If SelRow = nSetY Then
If SelCol = nSetX Then
FocusRect.Left = DRect.Left
FocusRect.Top = DRect.Top
FocusRect.Right = DRect.Right
FocusRect.Bottom = DRect.Bottom
DFRect.Left = DRect.Left + 2
DFRect.Top = DRect.Top + 2
DFRect.Right = DRect.Right - 3
DFRect.Bottom = DRect.Bottom - 3
'GDI.DrawLine DFRect.Left, DFRect.Top, DFRect.Right, DFRect.Bottom, , m_TableColor,, LineTypeB, 2
DrawFocusRect GDI.hdc, DFRect
End If
End If
GDI.ForeColor = ForeColorHead
End Select
Else
Select Case Table(1).TD(nSetX).Style
Case 0
sCoolWidth = DRect.Right - DRect.Left
sCoolHeight = DRect.Bottom - DRect.Top
CollRes.DrawLine 0, 0, sCoolWidth, sCoolHeight, m_TableColor, m_BackColor, LineTypeBf
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = CollAlpha
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, sCoolWidth, sCoolHeight, CollRes.hdc, 0, 0, sCoolWidth, sCoolHeight, lBF
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Bottom - 1, m_HeadShadowColor, , LineTypeB
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Top, m_HeadBrightColor
GDI.DrawLine DRect.Left, DRect.Top, DRect.Left, DRect.Bottom - 1, m_HeadBrightColor
'Rectangle GDI.hdc, DRect.Left, DRect.Top, DRect.Right + 1, DRect.Bottom + 1
SelectObject GDI.hdc, TableBrush
If SelRow = nSetY Then
If SelCol = nSetX Then
FocusRect.Left = DRect.Left
FocusRect.Top = DRect.Top
FocusRect.Right = DRect.Right
FocusRect.Bottom = DRect.Bottom
DFRect.Left = DRect.Left + 2
DFRect.Top = DRect.Top + 2
DFRect.Right = DRect.Right - 1
DFRect.Bottom = DRect.Bottom - 1
'GDI.DrawLine DFRect.Left, DFRect.Top, DFRect.Right, DFRect.Bottom,, m_TableColor, , LineTypeB, 2
DrawFocusRect GDI.hdc, DFRect
End If
End If
GDI.ForeColor = m_ForeColor
Case 1
If SelRow = nSetY Then
If SelCol = nSetX Then
FocusRect.Left = DRect.Left
FocusRect.Top = DRect.Top
FocusRect.Right = DRect.Right
FocusRect.Bottom = DRect.Bottom
DFRect.Left = DRect.Left + 2
DFRect.Top = DRect.Top + 2
DFRect.Right = DRect.Right - 3
DFRect.Bottom = DRect.Bottom - 3
'GDI.DrawLine DFRect.Left, DFRect.Top, DFRect.Right, DFRect.Bottom,, m_TableColor, , LineTypeB, 2
DrawFocusRect GDI.hdc, DFRect
End If
End If
If HadePic = True Then
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = 255
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, lBF
'StretchBlt GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, vbSrcCopy
Else
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right, DRect.Bottom, m_HeadBackColor, m_HeadBackColor, LineTypeBf
End If
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Bottom - 1, m_HeadShadowColor, , LineTypeB
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Top, m_HeadBrightColor
GDI.DrawLine DRect.Left, DRect.Top, DRect.Left, DRect.Bottom - 1, m_HeadBrightColor
GDI.ForeColor = ForeColorHead
End Select
End If
For Y = 1 To ForData
AddWidth = DrawXCount
For X = DrawX To DrawXEnd
If m_Check = True Then
If X = 1 Then
If Table(Y + memVScrollValue).IsHead = True Then
DRect.Left = AddWidth
DRect.Top = (Y - (1 + memVScrollValue)) * TRHeight
DRect.Right = DRect.Left + Check1.Width * 2
DRect.Bottom = DRect.Top + TRHeight
If HadePic = True Then
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = 255
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, lBF
'StretchBlt GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, vbSrcCopy
Else
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right, DRect.Bottom, m_TableColor, m_HeadBackColor, LineTypeBf
End If
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Bottom - 1, m_HeadShadowColor, , LineTypeB
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Top, m_HeadBrightColor
GDI.DrawLine DRect.Left, DRect.Top, DRect.Left, DRect.Bottom - 1, m_HeadBrightColor
Else
CheckCount = CheckCount + 1
If CheckCount = 1 Then
ReDim CheckRECT(CheckCount)
Else
ReDim Preserve CheckRECT(CheckCount)
End If
DRect.Left = AddWidth
DRect.Top = (Y - 1) * TRHeight
DRect.Right = DRect.Left + Check1.Width * 2
DRect.Bottom = DRect.Top + TRHeight
CheckRECT(CheckCount).Left = DRect.Left
CheckRECT(CheckCount).Top = DRect.Top
CheckRECT(CheckCount).Right = DRect.Right
CheckRECT(CheckCount).Bottom = DRect.Bottom
CheckRECT(CheckCount).Y = Y + memVScrollValue
CheckRECT(CheckCount).X = 0
sCoolWidth = DRect.Right + 1 - DRect.Left
sCoolHeight = DRect.Bottom + 1 - DRect.Top
If Table(Y + memVScrollValue).IsSelect = True Then
'SelectObject GDI.hdc, TableBrushSelect
CollRes.DrawLine 0, 0, sCoolWidth, sCoolHeight, m_TableColor, m_BackColorSelect, LineTypeBf
Else
'SelectObject GDI.hdc, TableBrush
CollRes.DrawLine 0, 0, sCoolWidth, sCoolHeight, , m_TableColor, m_BackColor, LineTypeBf
End If
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = CollAlpha
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, sCoolWidth, sCoolHeight, CollRes.hdc, 0, 0, sCoolWidth, sCoolHeight, lBF
'Rectangle GDI.hdc, DRect.Left, DRect.Top, DRect.Right + 1, DRect.Bottom + 1
DFRect.Left = Check1.Width / 2
DFRect.Top = ((Y - 1) * TRHeight) + (TRHeight / 2 - Check1.Height / 2)
DFRect.Right = DFRect.Left + Check1.Width
DFRect.Bottom = DFRect.Top + Check1.Height
If Table(Y + memVScrollValue).IsCheck = False Then
DrawFrameControl GDI.hdc, DFRect, DFC_BUTTON, DFCS_BUTTONCHECK
Else
DrawFrameControl GDI.hdc, DFRect, DFC_BUTTON, DFCS_CHECKED
End If
End If
AddWidth = AddWidth + Check1.Width * 2
End If
End If
If Table(1).TD(X).Visible = False Then
GoTo NextX
End If
PrintCaption = Table(Y + memVScrollValue).TD(X).Caption
' If InStr(1, PrintCaption, "变动情况") <> 0 Then
' PrintCaption = PrintCaption
' End If
PrintY = Y + memVScrollValue
PrintX = X
'取得目标单元格的矩形大小
DRect.Bottom = 0
If Table(Y + memVScrollValue).TD(X).IsRUnite = True Then
If Table(Y + memVScrollValue).TD(X).RowUniteCount = 0 Then
AddWidth = AddWidth + Table(1).TD(X).cWidth
GoTo NextX
End If
For I = Y To m_Rows
If Table(I + memVScrollValue).TD(X).IsRUnite = True Then
DRect.Bottom = DRect.Bottom + TRHeight
Else
Exit For
End If
Next I
Else
DRect.Bottom = TRHeight
End If
DRect.Right = 0
If Table(Y + memVScrollValue).TD(X).IsCUnite = True Then
If Table(Y + memVScrollValue).TD(X).ColUniteCount = 0 Then
AddWidth = AddWidth + Table(1).TD(X).cWidth
GoTo NextX
End If
For I = X To m_Cols
If Table(Y + memVScrollValue).TD(I).IsCUnite = True Then
DRect.Right = DRect.Right + Table(1).TD(I).cWidth
Else
X = I - 1
Exit For
End If
Next I
Else
DRect.Right = DRect.Right + Table(1).TD(X).cWidth
End If
DRect.Left = AddWidth
DRect.Top = (Y - 1) * TRHeight
AddWidth = AddWidth + DRect.Right
DRect.Right = DRect.Left + DRect.Right
DRect.Bottom = DRect.Top + DRect.Bottom
ButtonCount = ButtonCount + 1
If ButtonCount = 1 Then
ReDim ButtonRECT(ButtonCount)
Else
ReDim Preserve ButtonRECT(ButtonCount)
End If
If Table(Y + memVScrollValue).IsHead = True Then
ButtonRECT(ButtonCount).Left = DRect.Left
ButtonRECT(ButtonCount).Top = DRect.Top
ButtonRECT(ButtonCount).Right = DRect.Right
ButtonRECT(ButtonCount).Bottom = DRect.Bottom
If Table(Y + memVScrollValue).TD(X).IsRUnite = True Then
ButtonRECT(ButtonCount).Y = PrintY
Else
ButtonRECT(ButtonCount).Y = Y + memVScrollValue
End If
If Table(Y + memVScrollValue).TD(X).IsCUnite = True Then
ButtonRECT(ButtonCount).X = PrintX
Else
ButtonRECT(ButtonCount).X = X
End If
' FocusRect.Left = DRect.Left
' FocusRect.Top = DRect.Top
' FocusRect.Right = DRect.Right
' FocusRect.Bottom = DRect.Bottom
If HadePic = True Then
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = 255
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, lBF
'StretchBlt GDI.hdc, DRect.Left, DRect.Top, DRect.Right - DRect.Left, DRect.Bottom - DRect.Top, HadeRes.hdc, 0, 0, HadeRes.sWidth, HadeRes.sHeight, vbSrcCopy
Else
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right, DRect.Bottom, m_HeadBackColor, m_HeadBackColor, LineTypeBf
End If
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Bottom - 1, m_HeadShadowColor, , LineTypeB
GDI.DrawLine DRect.Left, DRect.Top, DRect.Right - 1, DRect.Top, m_HeadBrightColor
GDI.DrawLine DRect.Left, DRect.Top, DRect.Left, DRect.Bottom - 1, m_HeadBrightColor
GDI.ForeColor = ForeColorHead
DrawText GDI.hdc, PrintCaption, LenB(StrConv(PrintCaption, vbFromUnicode)), DRect, DT_CENTER Or DT_VCENTER Or DT_SINGLELINE
Public Sub Refresh()
Dim DrawX As Long
Dim DrawXCount As Long
Dim DrawXEnd As Long
Dim DrawXEndCount As Long
Dim DRect As RECT
Dim DFRect As RECT
Dim ForData As Long
Dim AddWidth As Long
Dim X As Long
Dim Y As Long
Dim nSetX As Long
Dim nSetY As Long
Dim I As Long
Dim PrintCaption As String
Dim PrintY As Long
Dim PrintX As Long
Dim ButtonCount As Long
Dim CheckCount As Long
Dim TmpRect As RECT
Dim BackBrush As Long
Dim BF As blendFunction, lBF As Long
Dim sCoolWidth As Long
Dim sCoolHeight As Long
If IsMessageBoxFocu = True Then
Exit Sub
End If
Dim RectW As Long
Dim RectH As Long
If m_Rows < 1 Then
Exit Sub
End If
If m_Cols < 1 Then
Exit Sub
End If
If MemResize = False Then
MemRefresh = True
UserControl_Resize
MemRefresh = False
End If
GDI.Cls
If BackPic = True Then
If m_BackFillStyle = Tile_Image Then
BackBrush = CreatePatternBrush(BackRes.hBitmap)
FillRect GDI.hdc, DBGridRect, BackBrush
DeleteObject BackBrush
Else
BF.AlphaFormat = 0
BF.BlendFlags = 0
BF.BlendOp = AC_SRC_OVER
BF.SourceConstantAlpha = 255
CopyMemory lBF, BF, 4
AlphaBlend GDI.hdc, 0, 0, DBGridRect.Right, DBGridRect.Bottom, BackRes.hdc, 0, 0, BackRes.sWidth, BackRes.sHeight, lBF
End If
End If
If m_Rows < 1 Or m_Cols < 1 Then
Exit Sub
End If
DrawX = 0
DrawXCount = 0
DrawXEnd = 0
DrawXEndCount = 0
ButtonCount = 0
CheckCount = 0
'找出开始横向绘制的开始项目数
For X = 1 To Cols
DrawXCount = DrawXCount + Table(1).TD(X).cWidth
If DrawXCount >= memHScrollValue Then
DrawXCount = DrawXCount - Table(1).TD(X).cWidth
DrawX = X
Exit For
End If
Next X
DrawXCount = (DrawXCount - memHScrollValue)
DrawXEndCount = -DrawXCount
DrawXEnd = DrawX
'找出开始横向绘制的停止项目数
For X = DrawXEnd To Cols
DrawXEndCount = DrawXEndCount + Table(1).TD(X).cWidth
DrawXEnd = X
If DrawXEndCount >= DBGridWidth + Table(1).TD(DrawX).cWidth * 2 Then
Exit For
End If
Next X
If NowShowRowCount > Rows Then
ForData = Rows
Else
ForData = NowShowRowCount
End If
FocusRect.Left = 0
FocusRect.Top = 0
FocusRect.Right = 0
FocusRect.Bottom = 0