📄 frmplaninfo.frm
字号:
Top = 2760
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "实施人员"
Height = 180
Index = 8
Left = 360
TabIndex = 21
Top = 2400
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "重要程度"
Height = 180
Index = 7
Left = 360
TabIndex = 20
Top = 1680
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "结束提醒"
Height = 180
Index = 6
Left = 4800
TabIndex = 19
Top = 2040
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "开始提醒"
Height = 180
Index = 5
Left = 2160
TabIndex = 18
Top = 2040
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "需要提醒"
Height = 180
Index = 4
Left = 360
TabIndex = 17
Top = 2040
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "开始时间"
Height = 180
Index = 3
Left = 2160
TabIndex = 16
Top = 1680
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "完成时间"
Height = 180
Index = 2
Left = 4800
TabIndex = 15
Top = 1680
Width = 720
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "事项"
Height = 180
Index = 0
Left = 600
TabIndex = 14
Top = 600
Width = 360
End
Begin VB.Label lblTitle
AutoSize = -1 'True
Caption = "客户名称"
Height = 180
Index = 1
Left = 240
TabIndex = 13
Top = 240
Width = 720
End
End
Attribute VB_Name = "frmPlanInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'欢迎你下载使用本代码,本份代码由程序太平洋提供下载学习之用
'声明:
'1.本站所有代码的版权归原作者所有,如果你使用了在本站下载的源代码
' 引起的一切纠纷(后果)与本站无关,请您尊重原作者的劳动成果!
'2.若本站在代码上有侵权之处请您与站长联系,站长会及时更正。
'网站:http://www.daima.com.cn
'程序太平洋:http://www.5ivb.net
'Email:dapha@etang.com
'CopyRight 2001-2005 By WangFeng
'整理时间:2004-12-14 23:41:45
''*************************************************************************
''**模 块 名:frmPlanInfo
''**说 明:多易工作室
''**创 建 人:邬浩杰
''**日 期:2004-12-14
''**修 改 人:
''**日 期:
''**描 述:
''**版 本:V1.0.0
''*************************************************************************
''''''''''''''''''''''''''''''''''''''''''''''''
'本模块为1.显示工作计划的详细信息,2.编辑工作计划信息,3.新建工作计划记录
'调用本模块前请先设置好Style属性,该属性为本模块的显示样式
'
''''''''''''''''''''''''''''''''''''''''''''''''
Option Explicit
'=================定义==========================
Dim mStyleInt As Integer
Dim mEnbledBool As Boolean
Dim mPlanCls As clsPlan
'===============================================
'=================属性==========================
'Style 属性决定本窗口的显示样式
Public Property Let Style(nStyle As Integer)
mStyleInt = nStyle
Call InitForm
End Property
Public Property Get Style() As Integer
Style = mStyleInt
End Property
'
Public Property Let TPlan(TMyPlan As clsPlan)
Set mPlanCls = TMyPlan
Call ShowInfo
End Property
Public Property Get TPlan() As clsPlan
Set TPlan = mPlanCls
End Property
'================================================
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdEdit_Click()
Me.Style = INT_PLAN_STYLE_EDIT
End Sub
Private Sub cmdOK_Click()
Dim MyObject As Control, i As Integer, strTag As String, nTag As Integer, nIndex As Integer
If Not (mPlanCls Is Nothing) Then
For Each MyObject In Me.Controls
strTag = MyObject.Tag ' tag属性为该控件对应相应的数据库字段编号
If IsNumeric(strTag) Then
nTag = CInt(strTag)
If nTag >= 0 And nTag < INT_PLAN_TITLE_COUNT_NUMBER Then
Select Case UCase(TypeName(MyObject)) '根据控件的不同类型,来读取相应的属性值
Case "TEXTBOX"
mPlanCls.MyProperty(nTag) = MyObject.Text
Case "DTPICKER"
mPlanCls.MyProperty(nTag) = MyObject.Value
Case "COMBOBOX"
mPlanCls.MyProperty(nTag) = MyObject.Text
End Select
End If
End If
Next
If cmbField(2).Text <> "" Then
nIndex = cmbField(2).ListIndex
mPlanCls.Client = cmbField(2).ItemData(nIndex)
End If
'Call SaveTPlanToDataBase(mPlanCls)
mPlanCls.IsChangedDate = True
End If
Unload Me
End Sub
Public Function ShowInfo() As Boolean
Dim MyObject As Control, strTag As String, nTag As Integer, strTemp As String
If Not (TPlan Is Nothing) Then
For Each MyObject In Me.Controls
DoEvents
strTag = MyObject.Tag ' tag属性为该控件对应相应的数据库字段编号
If strTag = "工作计划名称" Then
Call ListClientName
End If
If IsNumeric(strTag) Then
nTag = CInt(strTag)
If nTag >= 0 And nTag < INT_PLAN_TITLE_COUNT_NUMBER Then
strTemp = mPlanCls.MyProperty(nTag)
If strTemp <> "" Then
Select Case UCase(TypeName(MyObject)) '根据控件的不同类型,来读取相应的属性值
Case "TEXTBOX"
MyObject.Text = strTemp
Case "DTPICKER"
MyObject.Value = strTemp
Case "COMBOBOX"
MyObject.Text = strTemp
End Select
End If
End If
End If
Next
ShowInfo = True
Else
ShowInfo = False
End If
End Function
Private Function InitForm()
Select Case Me.Style
Case INT_PLAN_STYLE_READ_ONLY
If mEnbledBool = True Then Call SetControlEnabled(False)
cmdOk.Visible = False
cmdEdit.Visible = True
Case INT_PLAN_STYLE_EDIT
cmdOk.Visible = True
cmdEdit.Visible = False
If mEnbledBool = False Then Call SetControlEnabled(True)
Case INT_PLAN_STYLE_NEW
cmdOk.Visible = True
cmdEdit.Visible = False
If mEnbledBool = False Then Call SetControlEnabled(True) '本来就是 True的可以不设置
End Select
End Function
Private Function SetControlEnabled(boolEnabled As Boolean)
Dim MyObject As Control
For Each MyObject In Me.Controls
DoEvents
Select Case UCase(TypeName(MyObject)) '改变 TEXTBOX DTPICKER COMBOBOX 三种控件的类型
Case "TEXTBOX"
MyObject.Enabled = boolEnabled
Case "DTPICKER"
MyObject.Enabled = boolEnabled
Case "COMBOBOX"
MyObject.Enabled = boolEnabled
End Select
Next
End Function
Private Function ListClientName()
Dim TDBClient As New clsDataBase, nCount As Integer, strClientName As String, strClientID As String
Dim i As Integer, nIndex As Integer, strTemp As String, lngClientID As Long
strTemp = mPlanCls.Client
nIndex = -1
Call TDBClient.OpenDB(DB_TABLE_CLIENT)
nCount = TDBClient.GetRecordCount
For i = 1 To nCount
strClientName = TDBClient.GetRecord(DB_FIELD_CLIENT_NAME)
strClientID = TDBClient.GetRecord(DB_FIELD_CLIENT_ID)
Call cmbField(2).AddItem(strClientName, i - 1)
If IsNumeric(strClientID) Then
lngClientID = CLng(strClientID)
If strClientID = strTemp Then
nIndex = i - 1
End If
cmbField(2).ItemData(i - 1) = lngClientID
End If
TDBClient.MoveNext
Next
TDBClient.CloseDB
Set TDBClient = Nothing
If nIndex >= 0 Then cmbField(2).ListIndex = nIndex
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -