?? checkvaluesingleform.frm
字號:
VERSION 5.00
Begin VB.Form checkvaluesingleform
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 3480
ClientLeft = 45
ClientTop = 435
ClientWidth = 3960
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3480
ScaleWidth = 3960
Begin VB.Frame Frame1
Height = 2895
Left = 0
TabIndex = 7
Top = -120
Width = 3975
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 300
Index = 0
Left = 1560
MaxLength = 40
TabIndex = 1
Top = 240
Visible = 0 'False
Width = 2055
End
Begin VB.TextBox Text1
Height = 300
Index = 1
Left = 1560
MaxLength = 100
TabIndex = 2
Top = 720
Width = 2055
End
Begin VB.TextBox Text1
Height = 1305
Index = 2
Left = 1560
MaxLength = 255
ScrollBars = 3 'Both
TabIndex = 3
Top = 1200
Width = 2055
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "檢驗值ID"
Height = 180
Index = 0
Left = 600
TabIndex = 10
Top = 360
Visible = 0 'False
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "檢驗值名稱"
Height = 180
Index = 1
Left = 420
TabIndex = 9
Top = 720
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "備注"
Height = 180
Index = 2
Left = 960
TabIndex = 8
Top = 1200
Width = 360
End
End
Begin VB.Frame Frame2
Height = 735
Left = 0
TabIndex = 0
Top = 2760
Width = 3975
Begin VB.CommandButton c_new
Caption = "新增"
Height = 375
Left = 360
TabIndex = 6
Top = 240
Width = 735
End
Begin VB.CommandButton c_save
Caption = "保存"
Height = 375
Left = 1680
TabIndex = 5
Top = 240
Width = 735
End
Begin VB.CommandButton c_cancel
Caption = "退出"
Height = 375
Left = 2880
TabIndex = 4
Top = 240
Width = 735
End
End
End
Attribute VB_Name = "checkvaluesingleform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 塊 名 稱 :檢驗值設置用戶操作界面
'* 功 能 描 述 :檢驗值設置用戶操作界面
'* 程序員姓名 : 石春曉
'* 最后修改人 : 石春曉
'* 最后修改時間:2005/09/19
'**************************************
Option Explicit
Public m_operatorType As Integer ' 操作類型 0 - 新增 1 - 修改
Public m_checkvalueid As String ' 修改時其它窗體傳遞過來的參數
Private m_checkvalueDAO As checkvalueDAO ' 數據庫操作類
Private m_recordset As ADODB.Recordset ' 數據操作數據集對象
Public f As String
Private Sub c_cancel_Click()
Unload Me
End Sub
Private Sub c_new_Click()
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newcheckvalue
Call clear
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifycheckvalue
clear
m_operatorType = 0
End If
End If
End Sub
Private Sub c_save_Click()
Call Check
If m_operatorType = 0 Then
If f = "0" Then
Exit Sub
Else
Call Newcheckvalue
End If
ElseIf m_operatorType = 1 Then
If f = "0" Then
Exit Sub
Else
Call Modifycheckvalue
End If
End If
Unload Me
End Sub
Private Sub Form_Load()
Set m_checkvalueDAO = New checkvalueDAO
Set m_recordset = New ADODB.Recordset
Me.Height = 4320
Me.Width = 4080
SetToCenter Me
If m_operatorType = 0 Then
Me.caption = "檢驗值_新增"
clear
Else
Me.caption = "檢驗值_修改"
FindByIdRefresh
End If
End Sub
'**************************************
'* 功 能 描 述 :檢驗值數據處理函數
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub Newcheckvalue()
'
Dim ret As Boolean
Call Check
ret = m_checkvalueDAO.Newcheckvalue(m_recordset, Trim(Text1(1).text), _
Trim(Text1(2).text))
End Sub
'**************************************
'* 功 能 描 述 :修改檢驗值處理函數
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub Modifycheckvalue()
'
Dim ret As Boolean
Call Check
ret = m_checkvalueDAO.Modifycheckvalue(m_recordset, Trim(Text1(1).text), _
Trim(Text1(2).text), m_checkvalueid)
End Sub
'**************************************
'* 功 能 描 述 :檢驗數據的合法性
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub Check()
f = "1"
If Trim(Text1(1).text) = "" Then
MainForm.g_msgText = "檢驗值名稱不能為空!"
HMsgBox MainForm.g_msgText, 0, 1
Text1(1).SetFocus
f = "0"
Exit Sub
End If
End Sub
'**************************************
'* 功 能 描 述 :根據檢驗值ID找到檢驗值資料并顯示在界面上
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub FindByIdRefresh()
Dim ret As Boolean
ret = m_checkvalueDAO.FindById(m_recordset, m_checkvalueid)
If ret Then
With m_recordset
Text1(0).text = Trim(.Fields(0))
Text1(1).text = Trim(.Fields(1))
Text1(2).text = Trim(.Fields(2))
m_recordset.Close
End With
Else
MainForm.g_msgText = "檢驗值ID不正確,請重新操作!"
HMsgBox MainForm.g_msgText, 0, 1
Unload Me
End If
End Sub
'**************************************
'* 功 能 描 述 :清除界面上文本框里的所有內容
'* 輸 入 參 數 :無
'* 輸 出 能 數 :無
'**************************************
Private Sub clear()
Text1(0).text = ""
Text1(1).text = ""
Text1(2).text = ""
End Sub
Private Sub Text1_Change(Index As Integer)
If InStr(Trim(Text1(1).text), "%") = 0 Then
Text1(1).text = Trim(Text1(1).text) & "%"
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -