?? frm_bminfocu.frm
字號:
VERSION 5.00
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_bminfocu
BackColor = &H00FF8080&
Caption = "部門信息查詢"
ClientHeight = 6000
ClientLeft = 60
ClientTop = 450
ClientWidth = 8595
Icon = "Frm_bminfocu.frx":0000
ScaleHeight = 6000
ScaleWidth = 8595
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3360
Top = 6195
Width = 4110
_ExtentX = 7250
_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 MSDataGridLib.DataGrid DataGrid1
Bindings = "Frm_bminfocu.frx":0ECA
Height = 5265
Left = 30
TabIndex = 6
Top = 660
Width = 8520
_ExtentX = 15028
_ExtentY = 9287
_Version = 393216
AllowUpdate = -1 'True
BackColor = 65280
ForeColor = 16711680
HeadLines = 1
RowHeight = 15
AllowDelete = -1 'True
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 VB.Frame Frame1
Appearance = 0 'Flat
BackColor = &H00FF8080&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 630
Left = 0
TabIndex = 0
Top = 0
Width = 8580
Begin 工程1.GurhanCoolButton GurhanCoolButton1
Height = 495
Left = 2415
TabIndex = 1
Top = 30
Width = 855
_ExtentX = 1508
_ExtentY = 873
ButtonIcon = "Frm_bminfocu.frx":0EDF
CaptionTitle = "添 加 "
ButtonBackColor = 16744576
BeginProperty Font {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
End
Begin 工程1.GurhanCoolButton GurhanCoolButton2
Height = 495
Left = 3600
TabIndex = 2
Top = 45
Width = 855
_ExtentX = 1508
_ExtentY = 873
ButtonIcon = "Frm_bminfocu.frx":1465
CaptionTitle = "刪 除 "
ButtonBackColor = 16744576
BeginProperty Font {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
End
Begin 工程1.GurhanCoolButton GurhanCoolButton4
Height = 495
Left = 4725
TabIndex = 3
Top = 45
Width = 855
_ExtentX = 1508
_ExtentY = 873
ButtonIcon = "Frm_bminfocu.frx":18BB
CaptionTitle = "修 改 "
ButtonBackColor = 16744576
BeginProperty Font {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
End
Begin 工程1.GurhanCoolButton GurhanCoolButton6
Height = 495
Left = 5880
TabIndex = 4
Top = 45
Width = 855
_ExtentX = 1508
_ExtentY = 873
ButtonIcon = "Frm_bminfocu.frx":1A15
CaptionTitle = "打 印 "
ButtonBackColor = 16744576
BeginProperty Font {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
End
Begin 工程1.GurhanCoolButton GurhanCoolButton7
Height = 495
Left = 7035
TabIndex = 5
Top = 45
Width = 975
_ExtentX = 1720
_ExtentY = 873
ButtonIcon = "Frm_bminfocu.frx":1EEF
CaptionTitle = "退 出 "
ButtonBackColor = 16744576
BeginProperty Font {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
End
Begin VB.Image Image1
Height = 435
Left = 210
Top = 105
Width = 1590
End
End
End
Attribute VB_Name = "Frm_bminfocu"
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 Form_Load()
'在程序裝入時必須加入
Call ResizeInit(Me)
If Frm_load.group = "3" Then
GurhanCoolButton1.Visible = False
GurhanCoolButton2.Visible = False
GurhanCoolButton4.Visible = False
End If
End Sub
Private Sub GurhanCoolButton1_CLICKED()
Frm_bminfo.Show
Frm_bminfo.Adodc1.Recordset.AddNew
End Sub
Private Sub GurhanCoolButton1_GotFocus()
Adodc1.RecordSource = "select * from tab_部門"
Adodc1.Refresh
End Sub
Private Sub GurhanCoolButton2_CLICKED()
Adodc1.Recordset.Delete
Adodc1.Refresh
Adodc1.RecordSource = "select * from tab_部門"
Adodc1.Refresh
End Sub
Private Sub GurhanCoolButton4_CLICKED()
Frm_bminfo.Adodc1.RecordSource = "select * from tab_部門 where 編碼 like '" & Frm_bminfocu.Adodc1.Recordset.Fields(0) & "'"
Frm_bminfo.Adodc1.Refresh
Frm_bminfo.Show
End Sub
Private Sub GurhanCoolButton7_CLICKED()
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 + -