📄 frmmun.frm
字号:
VERSION 5.00
Object = "{B02F3647-766B-11CE-AF28-C3A2FBE76A13}#2.5#0"; "SS32X25.OCX"
Begin VB.Form frmmun
Caption = "Unit of Measurement"
ClientHeight = 6540
ClientLeft = 60
ClientTop = 345
ClientWidth = 8310
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6540
ScaleWidth = 8310
Begin VB.Frame frminput
Height = 2655
Left = 120
TabIndex = 3
Top = 3600
Width = 7935
Begin VB.TextBox txtmead
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1800
TabIndex = 5
Top = 1680
Width = 2055
End
Begin VB.TextBox txtmeac
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1800
TabIndex = 4
Top = 600
Width = 2055
End
Begin VB.Label Label2
Caption = "Description:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 7
Top = 1680
Width = 975
End
Begin VB.Label Label1
Caption = "Unit Code of Measurement:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 6
Top = 480
Width = 1095
End
End
Begin VB.Frame frmlist
Height = 2895
Left = 120
TabIndex = 1
Top = 600
Width = 7935
Begin FPSpread.vaSpread vasent
Height = 2415
Left = 120
TabIndex = 2
Top = 240
Width = 7695
_Version = 131077
_ExtentX = 13573
_ExtentY = 4260
_StockProps = 64
EditEnterAction = 5
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MaxCols = 1
MaxRows = 1
SpreadDesigner = "frmmun.frx":0000
End
End
Begin PrjLDS.UserControl1 UserControl1
Height = 615
Left = 0
TabIndex = 0
Top = 0
Width = 8430
_ExtentX = 14870
_ExtentY = 1085
End
End
Attribute VB_Name = "frmmun"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mkey As String
Private Sub Form_Load()
Call InitToolBar
Call initspread
Call vasshow
lockspread vasent, True
frmSal.Height = 6200
frmSal.Width = 8850
End Sub
Private Sub initspread()
With vasent
.MaxRows = 0
.MaxCols = 2 'enuDetailCols.MaxCols
.ShadowColor = genuBACKCOLOR.CST_Grid_LostFocus
.Row = -1: .Col = -1
.BackColor = genuBACKCOLOR.CST_Grid_LostFocus
.GridColor = vbBlack
End With
Call SetSpreadHead
lockspread vasent, True
End Sub
Private Sub SetSpreadHead()
SetColHead vasent, 1, "Unit Code of Measurement", 20
SetColHead vasent, 2, "Description", 20
End Sub
Private Sub vasshow()
Dim rstent As Recordset
Dim sSQL As String
Dim lrow As Integer
sSQL = "select * from sysmun"
Set rstent = Acs_cnt.Execute(sSQL)
vasent.MaxRows = 1
lrow = 1
SetValue vasent, lrow, 1, rstent!meacode
SetValue vasent, lrow, 2, rstent!meadesc
rstent.Close
Set rstent = Nothing
End Sub
Private Sub InitToolBar()
With UserControl1
.DisplayButton "new", "new", False, , "new"
.DisplayButton "Save", "Save", False, , "Save"
.DisplayButton "Open", "Open", False, , "Open"
.DisplayButton "Modify", "Modify", False, , "Modify"
.DisplayButton "Undo", "Undo", False, , "Undo"
'.DisplayButton "Redo", "Redo", True, , "Redo"
'.DisplayButton "Delete", "Delete", False, , "Delete"
.DisplayButton "Cut", "Cut", False, , "Cut"
'.DisplayButton "Print", "Print", True, , "Print"
.DisplayButton "Close", "Close", False, , "Close"
End With
End Sub
'
'Private Sub modify()
' With UserControl1
' .DisplayButton "new", "new", False, , "new"
' .DisplayButton "Save", "Save", True, , "Save"
' .DisplayButton "Open", "Open", False, , "Open"
' .DisplayButton "Modify", "Modify", False, , "Modify"
' '.DisplayButton "Undo", "Undo", True, , "Undo"
' '.DisplayButton "Redo", "Redo", True, , "Redo"
' '.DisplayButton "Delete", "Delete", False, , "Delete"
' .DisplayButton "Cut", "Cut", False, , "Cut"
' '.DisplayButton "Print", "Print", False, , "Print"
' .DisplayButton "Close", "Close", True, , "Close"
' End With
'
'
'End Sub
Private Sub SetToolBar(ByVal mkey As String)
Select Case mkey
Case "modify"
With UserControl1
.DisplayButton "New", "New", False, , "New"
.DisplayButton "Delete", "Delete", False, , "Delete"
'.DisplayButton "Print", "Print", False, , "Print"
.DisplayButton "Modify", "Modify", False, , "Modify"
.DisplayButton "Save", "Save", True, , "Save"
.DisplayButton "Undo", "Undo", True, , "Undo"
.DisplayButton "Redo", "Redo", True, , "Redo"
.DisplayButton "Close", "Close", False, , "Close"
Call ChangeColor(vasent, vasent.ActiveRow, -1)
End With
lockspread vasent, False
'vasent.ActiveCol = 2
LockCell vasent, 1, True
Case "undo"
With UserControl1
.DisplayButton "New", "New", False, , "New"
.DisplayButton "Delete", "Delete", False, , "Delete"
'.DisplayButton "Print", "Print", True, , "Print"
.DisplayButton "Modify", "Modify", True, , "Modify"
.DisplayButton "Save", "Save", False, , "Save"
.DisplayButton "Undo", "Undo", False, , "Undo"
.DisplayButton "Redo", "Redo", False, , "Redo"
.DisplayButton "Close", "Close", True, , "Close"
End With
Call vasshow
lockspread vasent, True
Case "save"
With UserControl1
.DisplayButton "New", "New", True, , "New"
.DisplayButton "Delete", "Delete", False, , "Delete"
'.DisplayButton "Print", "Print", True, , "Print"
.DisplayButton "Save", "Save", False, , "Save"
.DisplayButton "Modify", "Modify", True, , "Modify"
.DisplayButton "Undo", "Undo", False, , "Undo"
.DisplayButton "Redo", "Redo", False, , "Redo"
.DisplayButton "Close", "Close", True, , "Close"
End With
End Select
End Sub
Private Sub UserControl1_ButtonClick(ByVal Button As MSComctlLib.Button)
mkey = LCase(Button.Key)
Select Case LCase(Button.Key)
Case "new"
Case "edit"
Case "save"
Call saveinfo
Case "delete"
Case "modify"
'Call modify
Case "close"
Unload Me
Case Else
End Select
Call SetToolBar(mkey)
End Sub
Private Sub saveinfo()
Dim sSQL As String
Dim entcode, entdesc As String
Dim tel, fax As String
Dim add1, add2, add3 As String
'On Error GoTo Fail
entcode = GetValue(vasent, 1, 1)
entdesc = GetValue(vasent, 1, 2)
add1 = GetValue(vasent, 1, 3)
add2 = GetValue(vasent, 1, 4)
add3 = GetValue(vasent, 1, 5)
tel = GetValue(vasent, 1, 6)
fax = GetValue(vasent, 1, 7)
sSQL = "update sysent set entcode = '" & entcode & "',entdesc = '" & entdesc & "',addres1 = '" & add1 & _
"', addres2 = '" & add2 & "', addres ='" & add3 & "',telnum = '" & tel & "' ,faxnum = '" & fax & "'"
Acs_cnt.Execute (sSQL)
Fail:
Exit Sub
End Sub
Private Sub vasent_Click(ByVal Col As Long, ByVal Row As Long)
If Row = 0 Then
Else
txtmeac = GetValue(vasent, Row, 1)
txtmead = GetValue(vasent, Row, 2)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -