?? khlylist.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form khlylist
Caption = "Form1"
ClientHeight = 5070
ClientLeft = 60
ClientTop = 450
ClientWidth = 6510
LinkTopic = "Form1"
ScaleHeight = 5070
ScaleWidth = 6510
StartUpPosition = 3 '窗口缺省
Begin MSComctlLib.Toolbar SzToolbar
Align = 1 'Align Top
Height = 570
Left = 0
TabIndex = 0
Top = 0
Width = 6510
_ExtentX = 11483
_ExtentY = 1005
ButtonWidth = 820
ButtonHeight = 953
AllowCustomize = 0 'False
Appearance = 1
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 9
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "新增"
Key = "xz"
ImageKey = "xz"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "修改"
Key = "xg"
ImageKey = "xg"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "刪除"
Key = "sc"
ImageKey = "sc"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Style = 3
EndProperty
BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
EndProperty
BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Caption = "查詢"
Key = "cx"
ImageKey = "cx"
EndProperty
BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "刷新"
Key = "sx"
ImageKey = "sx"
EndProperty
BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.Visible = 0 'False
Style = 3
EndProperty
BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出"
Key = "tc"
ImageKey = "tc"
EndProperty
EndProperty
BorderStyle = 1
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Appearance = 0 'Flat
ForeColor = &H80000006&
Height = 270
Left = 4920
TabIndex = 2
Text = "Text1"
Top = 120
Width = 975
End
Begin MSComctlLib.ImageList ImageList1
Left = 5880
Top = 0
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 7
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":0000
Key = "dy"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":039A
Key = "xg"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":0734
Key = "tc"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":0ACE
Key = "xz"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":0E68
Key = "sc"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":1202
Key = "sx"
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "khlylist.frx":159C
Key = "cx"
EndProperty
EndProperty
End
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid hfg_houseList
Height = 4455
Left = 0
TabIndex = 1
Top = 600
Width = 6495
_ExtentX = 11456
_ExtentY = 7858
_Version = 393216
BackColor = -2147483634
Cols = 4
FixedCols = 0
RowHeightMin = 300
BackColorFixed = 15723503
AllowUserResizing= 3
_NumberOfBands = 1
_Band(0).Cols = 4
End
End
Attribute VB_Name = "khlylist"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**************************************
'* 模 塊 名 稱 :客戶來源設置用戶操作界面
'* 功 能 描 述 :客戶來源設置用戶操作界面
'* 程序員姓名 : 石春曉
'* 最后修改人 : 石春曉
'* 最后修改時間:2005/10/11
'**************************************
Option Explicit
Private m_gyslbDAO As gyslbDAO ' 聯(lián)系方式數(shù)據(jù)庫操作類
Private m_recordset As ADODB.Recordset ' 數(shù)據(jù)操作數(shù)據(jù)集對象
'**************************************
'* 功 能 描 述 :窗體加載函數(shù)
'* 輸 入 參 數(shù) :無
'* 輸 出 能 數(shù) :無
'**************************************
Private Sub Form_Load()
Set m_gyslbDAO = New gyslbDAO
Set m_recordset = New ADODB.Recordset
Me.caption = "客戶來源設置"
RefreshListTitle
refreshlist
Me.Height = 5565
Me.Width = 6615
SetToCenter Me
End Sub
Private Sub Form_Resize()
hfg_houseList.Height = Me.Height - 1400
hfg_houseList.Width = Me.Width - 350
' Image1.Stretch = False
If (hfg_houseList.Height > hfg_houseList.Height - 300) Or (hfg_houseList.Width > hfg_houseList.Width - 200) Then
hfg_houseList.Height = hfg_houseList.Height + 400
hfg_houseList.Width = hfg_houseList.Width + 200
'
' Image1.Stretch = True
End If
End Sub
Private Sub hfg_houseList_DblClick()
' 修改
khly.m_operatorType = 1
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) <> "" Then
khly.m_khlyid = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
khly.show 1
refreshlist
End If
End Sub
'**************************************
'* 功 能 描 述 :工具欄按鈕的單擊操作按鈕
'* 輸 入 參 數(shù) :無
'* 輸 出 能 數(shù) :無
'**************************************
Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "xz" ' 新增
khly.m_operatorType = 0
khly.show 1
refreshlist
Case "xg" ' 修改
khly.m_operatorType = 1
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) <> "" Then
khly.m_khlyid = Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
khly.show 1
refreshlist
End If
Case "sc" ' 刪除
Call delete
Call refreshlist
Case "sx" '刷 新
Call refreshlist
Case "tc" '退 出
Unload Me
End Select
End Sub
'**************************************
'* 功 能 描 述 :刷新倉庫列表
'* 輸 入 參 數(shù) :無
'* 輸 出 能 數(shù) :無
'**************************************
Private Sub refreshlist()
Dim currentrow As Integer ' 當前插入的行
m_gyslbDAO.FindkhlyAll m_recordset
' Set hfg_houseList.DataSource = m_recordset ' 數(shù)據(jù)源綁定到顯示控件
hfg_houseList.clear
hfg_houseList.Rows = 2
RefreshListTitle
With m_recordset
' hfg_houseList.Rows = m_recordset.RecordCount
currentrow = 1
Do While Not .EOF
If currentrow > hfg_houseList.Rows - 1 Then
hfg_houseList.AddItem ""
End If
'[>>自定義填充內(nèi)容
hfg_houseList.TextMatrix(currentrow, 0) = Trim(.Fields("客戶來源ID"))
hfg_houseList.TextMatrix(currentrow, 1) = Trim(.Fields("序號"))
hfg_houseList.TextMatrix(currentrow, 2) = Trim(.Fields("客戶來源"))
hfg_houseList.TextMatrix(currentrow, 3) = Trim(.Fields("備注"))
'<<]
'設置數(shù)據(jù)行高度(Fixed)
hfg_houseList.RowHeight(currentrow) = 200
'動態(tài)集指針加1,同時將計數(shù)器加1(Fixed)
.MoveNext
currentrow = currentrow + 1
Loop
End With
Text1.text = Trim(m_recordset.RecordCount)
m_recordset.Close
End Sub
'**************************************
'* 功 能 描 述 :刪除一條記錄
'* 輸 入 參 數(shù) :無
'* 輸 出 能 數(shù) :無
'**************************************
Private Sub delete()
Dim ret As Integer
If Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0)) = "" Then
MainForm.g_msgText = "請選擇一條記錄!"
HMsgBox MainForm.g_msgText, 0, 1
End If
MainForm.g_msgText = "確定刪除這條記錄嗎?"
ret = HMsgBox(MainForm.g_msgText, 2, 2)
If ret = 1 Then
m_gyslbDAO.DeletekhlyId m_recordset, Trim(hfg_houseList.TextMatrix(hfg_houseList.row, 0))
End If
End Sub
'**************************************
'* 功 能 描 述 :刷新列表的標題欄
'* 輸 入 參 數(shù) :無
'* 輸 出 能 數(shù) :無
'**************************************
Private Sub RefreshListTitle()
hfg_houseList.TextMatrix(0, 0) = "客戶來源ID"
hfg_houseList.TextMatrix(0, 1) = "序號"
hfg_houseList.TextMatrix(0, 2) = "客戶來源"
hfg_houseList.TextMatrix(0, 3) = "備注"
'設置列對齊方式 7-右對齊 5-居中對齊 2-左對齊
hfg_houseList.ColAlignment(0) = 2
hfg_houseList.ColAlignment(1) = 8
hfg_houseList.ColAlignment(2) = 2
hfg_houseList.ColAlignment(3) = 2
hfg_houseList.ColWidth(0) = 1
hfg_houseList.ColWidth(2) = 2000
hfg_houseList.ColWidth(3) = 3000
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -