?? frmabgl.frm
字號:
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
Object.Visible = 0 'False
ColumnWidth = 2085.166
EndProperty
BeginProperty Column01
ColumnWidth = 1305.071
EndProperty
BeginProperty Column02
ColumnWidth = 1500.095
EndProperty
BeginProperty Column03
ColumnWidth = 1200.189
EndProperty
BeginProperty Column04
ColumnWidth = 1200.189
EndProperty
BeginProperty Column05
ColumnWidth = 1200.189
EndProperty
BeginProperty Column06
ColumnWidth = 1500.095
EndProperty
EndProperty
End
Begin VB.Label Label8
Caption = "備注:"
Height = 225
Left = 6720
TabIndex = 19
Top = 750
Visible = 0 'False
Width = 675
End
Begin VB.Label Label7
Caption = " 以上數據以毫米為單位"
Height = 285
Left = 6480
TabIndex = 18
Top = 150
Width = 2175
End
Begin VB.Label Label6
Caption = "安標高度:"
Height = 225
Left = 4440
TabIndex = 17
Top = 750
Width = 915
End
Begin VB.Label Label5
Caption = "安標全稱:"
Height = 225
Left = 2310
TabIndex = 16
Top = 180
Width = 915
End
Begin VB.Label Label4
Caption = "安標寬度:"
Height = 225
Left = 2310
TabIndex = 15
Top = 750
Width = 915
End
Begin VB.Label Label3
Caption = "安標圖像:"
Height = 225
Left = 150
TabIndex = 13
Top = 750
Width = 915
End
Begin VB.Label Label2
Caption = "安標顯示"
Height = 255
Left = 6900
TabIndex = 12
Top = 4860
Visible = 0 'False
Width = 825
End
Begin VB.Image pict_card
Height = 495
Left = 5640
Stretch = -1 'True
Top = 90
Width = 495
End
Begin VB.Label Label1
Caption = "安標簡稱:"
Height = 225
Left = 150
TabIndex = 0
Top = 180
Width = 915
End
End
Attribute VB_Name = "frmabgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsTemp As ADODB.Recordset
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub cmddel_Click()
On Error Resume Next
If Adoabgl.Recordset.RecordCount > 0 Then
If MsgBox("確定要刪除該記錄嗎?", 4 + 32, "刪除確認") = 6 Then
Adoabgl.Recordset.Delete
Adoabgl.Recordset.MoveNext
If Adoabgl.Recordset.RecordCount > 0 Then Adoabgl.Recordset.MoveLast
End If
Else
MsgBox "記錄已為空!", 0 + 64, "信息窗"
End If
End Sub
Private Sub cmdEdit_Click()
On Error Resume Next
If cmdedit.Caption = "修改" Then
abmc.Enabled = True
abqc.Enabled = True
ablj.Enabled = True
abkd.Enabled = True
abgd.Enabled = True
cmdpic.Enabled = True
bz.Enabled = True
varMark = Adoabgl.Recordset.Bookmark '記下當前記錄的位置
cmdedit.Caption = "保存"
Exit Sub
End If
If cmdedit.Caption = "保存" Then
Adoabgl.Recordset.Update
Adoabgl.Recordset.Requery
Adoabgl.Recordset.Bookmark = varMark
abmc.Enabled = False
abqc.Enabled = False
ablj.Enabled = False
abkd.Enabled = False
abgd.Enabled = False
bz.Enabled = False
cmdpic.Enabled = False
cmdedit.Caption = "修改"
Exit Sub
End If
If cmdedit.Caption = "取消" Then
Adoabgl.Recordset.Delete
cmdedit.Caption = "修改"
Exit Sub
End If
End Sub
Private Sub cmdpic_Click()
On Error Resume Next
Dim sFile As String
With dlgDialogpict
.DialogTitle = "打開"
.CancelError = False
'ToDo: 設置 common dialog 控件的標志和屬性
.Filter = "圖象文件 (*.bmp)|*.bmp|JPG文件(*.jpg)|*.jpg|ICO文件(*.ico)|*.ico"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileTitle
' MsgBox vFldVal(.FileTitle), 0 + 64, "信息窗"
End With
ablj.Text = sFile '儲存圖象文件名
pict_card.Picture = LoadPicture(SystemDir & "\picture\" & sFile)
Text1.Text = vFldVal(pict_card.Width)
End Sub
Private Sub cmdadd_Click()
On Error Resume Next
If cmdadd.Caption = "添加" Then
Adoabgl.Recordset.AddNew
abmc.Enabled = True
abqc.Enabled = True
ablj.Enabled = True
abkd.Enabled = True
abgd.Enabled = True
bz.Enabled = True
cmdpic.Enabled = True
abmc.SetFocus
cmdadd.Caption = "保存"
cmdedit.Caption = "取消"
Else
If (Trim(abmc.Text) = "" Or Trim(abqc.Text) = "") Then
MsgBox "安標簡稱和全稱都不能為空!", 0 + 16, "提示窗"
Exit Sub
End If
If Trim(ablj.Text) = "" Then
MsgBox "安標圖像不能為空!", 0 + 16, "提示窗"
Exit Sub
End If
rsTemp.Close
rsTemp.Open "select * from 安標表 where 安標簡稱='" & Trim(abmc.Text) & "'", cnSys
If rsTemp.RecordCount > 0 Then
MsgBox "該安標簡稱已存在,請認真檢查!", 0 + 16, "提示窗"
cmdedit.Caption = "取消"
cmdadd.Caption = "添加"
Exit Sub
End If
Adoabgl.Recordset.Update
Adoabgl.Recordset.Requery '該語句非常重要,否則 Update 將出錯
abmc.Enabled = False
abqc.Enabled = False
ablj.Enabled = False
abkd.Enabled = False
abgd.Enabled = False
bz.Enabled = False
cmdpic.Enabled = False
cmdadd.Caption = "添加"
cmdedit.Caption = "修改"
End If
End Sub
Private Sub cmdSearch_Click()
On Error Resume Next
tabname = "安標表"
If cmdsearch.Caption = "查找" Then
frmSearch.Show vbModal
If strQuery <> "" Then
Adoabgl.RecordSource = strQuery
Adoabgl.Refresh
cmdsearch.Caption = "重置"
End If
Else
strQuery = "Select * From " & tabname
Adoabgl.RecordSource = strQuery
Adoabgl.Refresh
cmdsearch.Caption = "查找"
End If
End Sub
Private Sub DataGrid2_Click()
On Error Resume Next
If Trim(abkd.Text) <> "" Then
pict_card.Width = Val(abkd.Text) * stunit
End If
If Trim(abgd.Text) <> "" Then
pict_card.Height = Val(abgd.Text) * stunit
End If
pict_card.Picture = LoadPicture(SystemDir & "\picture\" & Trim(ablj.Text))
'Text1.Text = vFldVal(pict_card.Width)
End Sub
Private Sub Form_Load()
Dim abgltemp As String
On Error Resume Next
abgltemp = "無"
Set rsTemp = New ADODB.Recordset '初始化數據庫
rsTemp.CursorType = adOpenKeyset
rsTemp.CursorLocation = adUseClient
rsTemp.LockType = adLockOptimistic
rsTemp.Open "select * from 安標表 where 安標簡稱='" & abgltemp & "'", cnSys
Adoabgl.ConnectionString = strConn
Adoabgl.RecordSource = "Select * From 安標表"
Adoabgl.Refresh
'abmc.Text = ""
abmc.Enabled = False
abqc.Enabled = False
ablj.Enabled = False
abkd.Enabled = False
abgd.Enabled = False
bz.Enabled = False
cmdpic.Enabled = False
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -