📄 frm_bainfo.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Frm_bainfo
BackColor = &H00FF8080&
Caption = "保安排班查询"
ClientHeight = 8385
ClientLeft = 60
ClientTop = 450
ClientWidth = 9180
Icon = "Frm_bainfo.frx":0000
LinkTopic = "Form1"
ScaleHeight = 8385
ScaleWidth = 9180
StartUpPosition = 1 '所有者中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2010
Top = 8550
Width = 3735
_ExtentX = 6588
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\TIZIANO.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\TIZIANO.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tab_保安排班"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin 工程1.GurhanButton GurhanButton3
Height = 435
Left = 7680
TabIndex = 6
Top = 510
Width = 1425
_ExtentX = 2514
_ExtentY = 767
Caption = "返 回 "
Picture = "Frm_bainfo.frx":0CCA
OriginalPicSizeW= 18
OriginalPicSizeH= 18
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "Frm_bainfo.frx":115C
MousePointer = 99
BackColor = 16744576
End
Begin 工程1.GurhanButton GurhanButton2
Height = 465
Left = 6090
TabIndex = 5
Top = 510
Width = 1425
_ExtentX = 2514
_ExtentY = 820
Caption = "删 除 "
Picture = "Frm_bainfo.frx":1476
OriginalPicSizeW= 18
OriginalPicSizeH= 17
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "Frm_bainfo.frx":18CC
MousePointer = 99
BackColor = 16744576
End
Begin 工程1.GurhanButton GurhanButton1
Height = 465
Left = 4530
TabIndex = 4
Top = 510
Width = 1365
_ExtentX = 2408
_ExtentY = 820
Caption = "添 加 "
Picture = "Frm_bainfo.frx":1BE6
OriginalPicSizeW= 16
OriginalPicSizeH= 15
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MouseIcon = "Frm_bainfo.frx":216C
MousePointer = 99
BackColor = 16744576
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Frm_bainfo.frx":2486
Height = 7305
Left = 60
TabIndex = 3
Top = 1080
Width = 9075
_ExtentX = 16007
_ExtentY = 12885
_Version = 393216
BackColor = 65280
ForeColor = 16711680
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 375
Left = 60
TabIndex = 0
Top = 600
Width = 4125
_ExtentX = 7276
_ExtentY = 661
_Version = 393216
Format = 76873729
CurrentDate = 38882
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H0080FFFF&
Caption = "请选择日期"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 120
TabIndex = 1
Top = 90
Width = 1800
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00000000&
Caption = "请选择日期"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 180
TabIndex = 2
Top = 150
Width = 1800
End
End
Attribute VB_Name = "Frm_bainfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private ObjOldWidth As Long '保存窗体的原始宽度
Private ObjOldHeight As Long '保存窗体的原始高度
Private ObjOldFont As Single '保存窗体的原始字体比
Private Sub DTPicker1_Change()
Adodc1.RecordSource = "select * from tab_保安排班 where 值班日期 like '" & DTPicker1.Value & "'"
Adodc1.Refresh
'List1.DataSource = Adodc1
'List1.DataField = 值班日期
'DataGrid1.DataSource = Adodc1
End Sub
Private Sub Form_Load()
If Frm_load.group = "3" Then
GurhanCoolButton1.Visible = False
GurhanCoolButton2.Visible = False
'GurhanCoolButton4.Visible = False
End If
Call ResizeInit(Me)
End Sub
Private Sub GurhanButton1_Click()
Frm_bapb.Show
Frm_bapb.Adodc1.Recordset.AddNew
End Sub
Private Sub GurhanButton1_GotFocus()
Adodc1.RecordSource = "select * from tab_保安排班"
Adodc1.Refresh
End Sub
Private Sub GurhanButton2_Click()
Dim res As Integer
res = MsgBox("确实要删除此信息吗?", vbExclamation + vbYesNo + vbDefaultButton2)
If res = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Refresh
End If
Adodc1.RecordSource = "select * from tab_保安排班"
Adodc1.Refresh
End Sub
Private Sub GurhanButton3_Click()
Unload Me
End Sub
'在调用ResizeForm前先调用本函数
Public Sub ResizeInit(FormName As Form)
Dim Obj As Control
ObjOldWidth = FormName.ScaleWidth
ObjOldHeight = FormName.ScaleHeight
ObjOldFont = FormName.Font.Size / ObjOldHeight
On Error Resume Next
For Each Obj In FormName
Obj.Tag = Obj.Left & " " & Obj.Top & " " & Obj.Width & " " & Obj.Height & " "
Next Obj
On Error GoTo 0
End Sub
'按比例改变表单内各元件的大小,
'在调用ReSizeForm前先调用ReSizeInit函数
Public Sub ResizeForm(FormName As Form)
Dim Pos(4) As Double
Dim i As Long, TempPos As Long, StartPos As Long
Dim Obj As Control
Dim ScaleX As Double, ScaleY As Double
ScaleX = FormName.ScaleWidth / ObjOldWidth
'保存窗体宽度缩放比例
ScaleY = FormName.ScaleHeight / ObjOldHeight
'保存窗体高度缩放比例
On Error Resume Next
For Each Obj In FormName
StartPos = 1
For i = 0 To 4
'读取控件的原始位置与大小
TempPos = InStr(StartPos, Obj.Tag, " ", vbTextCompare)
If TempPos > 0 Then
Pos(i) = Mid(Obj.Tag, StartPos, TempPos - StartPos)
StartPos = TempPos + 1
Else
Pos(i) = 0
End If
'根据控件的原始位置及窗体改变大
'小的比例对控件重新定位与改变大小
Obj.Move Pos(0) * ScaleX, Pos(1) * ScaleY, Pos(2) * ScaleX, Pos(3) * ScaleY
Obj.Font.Size = ObjOldFont * FormName.ScaleHeight
Next i
Next Obj
On Error GoTo 0
End Sub
Private Sub Form_Resize()
'确保窗体改变时控件随之改变
Call ResizeForm(Me)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -