⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clsrect.cls

📁 办公流程定制
💻 CLS
📖 第 1 页 / 共 2 页
字号:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsRect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
Private mvarSetActiveFlag As Boolean
'保持属性值的局部变量
Private mvarBeginPoint As POINTAPI '局部复制
Private mvarEndPoint As POINTAPI '局部复制
Private mvarDrawFrm As Object '局部复制
Private mvarMidPointCount As Integer '局部复制
Private mvarMidPoint() As POINTAPI '局部复制
Private mvarRectNo As Integer '局部复制
Private mvarClsName As String '局部复制
Private picCache As PictureBox
Private mvarImgList As ImageList

Const SRCCOPY = &HCC0020

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
'保持属性值的局部变量
Private mvarAddAttach As Boolean '局部复制
Private mvarSeeAttach As Boolean '局部复制
Private mvarAddAdvice As Boolean '局部复制
Private mvarSeeAdvice As Boolean '局部复制
Private mvarAgreeNum As Integer '局部复制
Private mvarNodeName As String '局部复制
'保持属性值的局部变量
Private mvarNodeType As Integer '局部复制
'保持属性值的局部变量
Private mvarUserName As String '局部复制
Private mvarUserName_C As String '局部复制
'保持属性值的局部变量
Private mvarRefAppTable As String '局部复制
Public Property Let RefAppTable(ByVal vData As String)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.RefAppTable = 5
    mvarRefAppTable = vData
End Property


Public Property Get RefAppTable() As String
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.RefAppTable
    RefAppTable = mvarRefAppTable
End Property



Public Property Let UserName_C(ByVal vData As String)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.UserName_C = 5
    mvarUserName_C = vData
End Property


Public Property Get UserName_C() As String
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.UserName_C
    UserName_C = mvarUserName_C
End Property



Public Property Let UserName(ByVal vData As String)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.UserName = 5
    mvarUserName = vData
End Property


Public Property Get UserName() As String
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.UserName
    UserName = mvarUserName
End Property



Public Property Let NodeType(ByVal vData As Integer)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.NodeType = 5
    mvarNodeType = vData
End Property


Public Property Get NodeType() As Integer
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.NodeType
    NodeType = mvarNodeType
End Property



Public Property Let NodeName(ByVal vData As String)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.NodeName = 5
    mvarNodeName = vData
End Property


Public Property Get NodeName() As String
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.NodeName
    NodeName = mvarNodeName
End Property

Public Property Let AgreeNum(ByVal vData As Integer)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.AgreeNum = 5
    mvarAgreeNum = vData
End Property


Public Property Get AgreeNum() As Integer
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.AgreeNum
    AgreeNum = mvarAgreeNum
End Property



Public Property Let SeeAdvice(ByVal vData As Boolean)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.SeeAdvice = 5
    mvarSeeAdvice = vData
End Property


Public Property Get SeeAdvice() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.SeeAdvice
    SeeAdvice = mvarSeeAdvice
End Property



Public Property Let AddAdvice(ByVal vData As Boolean)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.AddAdvice = 5
    mvarAddAdvice = vData
End Property


Public Property Get AddAdvice() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.AddAdvice
    AddAdvice = mvarAddAdvice
End Property



Public Property Let SeeAttach(ByVal vData As Boolean)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.SeeAttach = 5
    mvarSeeAttach = vData
End Property


Public Property Get SeeAttach() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.SeeAttach
    SeeAttach = mvarSeeAttach
End Property



Public Property Let AddAttach(ByVal vData As Boolean)
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.AddAttach = 5
    mvarAddAttach = vData
End Property


Public Property Get AddAttach() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.AddAttach
    AddAttach = mvarAddAttach
End Property




'*******************************************************
'*******************************************************
'类的所有应用属性定义
'*******************************************************
'*******************************************************
Public Property Set Cache(oNewValue As Object)
    On Error Resume Next
    Set picCache = oNewValue
End Property
'=======================================================
'获得、设置类的名称
'=======================================================
Public Property Let ClsName(ByVal vData As String)
'Syntax: X.LineName = 5
    mvarClsName = vData
End Property
Public Property Get ClsName() As String
'Syntax: Debug.Print X.LineName
    ClsName = mvarClsName
End Property
'=======================================================
'获得、设置矩形的序号
'=======================================================
Public Property Let RectNo(ByVal vData As Integer)
'Syntax: X.RectNo = 5
    mvarRectNo = vData
End Property

Public Property Get RectNo() As Integer
'Syntax: Debug.Print X.RectNo
    RectNo = mvarRectNo
End Property

'=======================================================
'获得、设置线的中间点个数
'=======================================================
Public Property Let MidPointCount(ByVal vData As Integer)
'Syntax: Set x.MidPointCount = Form1
    mvarMidPointCount = vData
    ReDim Preserve mvarMidPoint(vData) '设置中间点的保存结构
End Property

Public Property Get MidPointCount() As Integer
'Syntax: Debug.Print X.MidPointCount
    MidPointCount = mvarMidPointCount
End Property

'=======================================================
'获得、设置画线载体
'=======================================================
Public Property Set SetImageList(ByVal vData As Object)
'Syntax: Set x.DrawFrm = Form1
    Set mvarImgList = vData
End Property
Public Property Set DrawFrm(ByVal vData As Object)
'Syntax: Set x.DrawFrm = Form1
    Set mvarDrawFrm = vData
End Property

Public Property Get DrawFrm() As Object
'Syntax: Debug.Print X.DrawFrm
    Set DrawFrm = mvarDrawFrm
End Property

'=======================================================
'获得、设置线的终点
'=======================================================
Public Property Let EndPoint(vData As POINTAPI)
'Syntax: Set x.EndPoint = Form1
    mvarEndPoint = vData
End Property

Public Property Get EndPoint() As POINTAPI
'Syntax: Debug.Print X.EndPoint
    EndPoint = mvarEndPoint
End Property

'=======================================================
'获得、设置线起点
'=======================================================
Public Property Let BeginPoint(vData As POINTAPI)
'Syntax: Set x.BeginPoint = Form1
    mvarBeginPoint = vData
End Property

Public Property Get BeginPoint() As POINTAPI
'Syntax: Debug.Print X.BeginPoint
    BeginPoint = mvarBeginPoint
End Property

'********************************************************
'********************************************************
'类的应用方法定义
'*********************************************************
'*********************************************************
Public Sub Paint() '
Dim X1, X2, Y1, Y2 As Long
Dim i, j, k, strLong As Integer
Dim tmpStr As String
    '==========================
    mvarDrawFrm.DrawMode = 13
    mvarDrawFrm.DrawWidth = 1
    mvarDrawFrm.DrawStyle = 0
    mvarDrawFrm.FillStyle = 0
    '============================
    X1 = mvarEndPoint.X - 300
    X2 = mvarEndPoint.X + 300
    Y1 = mvarEndPoint.Y - 400
    Y2 = mvarEndPoint.Y + 400
    
    '============================
    '==============================
    If Trim$(mvarNodeName) = "" Then
        If mvarRectNo = 1 Then
            tmpStr = "开始节点"
            mvarNodeType = 1
        Else
            tmpStr = "第" & mvarRectNo & "节点"
            mvarNodeType = 4
        End If
    Else
        tmpStr = mvarNodeName
    End If
    '============================
    Dim lResult As Long
    Dim hDestDC As Long
    Dim hSrcDC As Long
    If mvarNodeType = 1 Or mvarNodeType = 2 Then
        Set picCache.Picture = mvarImgList.ListImages(3).Picture
    ElseIf mvarNodeType = 3 Then
        Set picCache.Picture = mvarImgList.ListImages(2).Picture
    Else
        Set picCache.Picture = mvarImgList.ListImages(1).Picture

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -