|
代码如下:#region ### START Koda GUI section ### Form=c:\users\mason-home\desktop\外包人员管理软件单机版\公司管理.kxf
$Main = GUICreate("公司管理", 785, 584, 410, 124)
$MenuItem1 = GUICtrlCreateMenu("设置(&Y)")
$MenuItem3 = GUICtrlCreateMenuItem("用户管理", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("参数设置", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("帮助(&Z)")
$MenuItem5 = GUICtrlCreateMenuItem("关于", $MenuItem2)
$MenuItem6 = GUICtrlCreateMenuItem("退出", $MenuItem2)
$StatusBar = _GUICtrlStatusBar_Create($Main)
Dim $StatusBar_PartsWidth[2] = [400, -1]
_GUICtrlStatusBar_SetParts($StatusBar, $StatusBar_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar, "", 0)
_GUICtrlStatusBar_SetText($StatusBar, "", 1)
$Tab1 = GUICtrlCreateTab(0, 0, 780, 540, $TCS_BUTTONS)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$TabSheet2 = GUICtrlCreateTabItem("公司管理")
$TreeView1 = GUICtrlCreateTreeView(4, 28, 120, 505, BitOR($GUI_SS_DEFAULT_TREEVIEW, $WS_BORDER))
$Group1 = GUICtrlCreateGroup("公司基本信息", 144, 28, 545, 505)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Button1", 696, 56, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 696, 139, 75, 25)
$Button3 = GUICtrlCreateButton("Button3", 696, 221, 75, 25)
$Button4 = GUICtrlCreateButton("Button4", 696, 304, 75, 25)
$TabSheet3 = GUICtrlCreateTabItem("人员管理")
$TabSheet4 = GUICtrlCreateTabItem("TabSheet4")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Tab1
$tabidx = GUICtrlRead($Tab1)
Select
Case $tabidx = 0
Case $tabidx = 1;公司管理标签
_getCompanyTree()
EndSelect
EndSwitch
WEnd
Func _getCompanyTree()
_GUICtrlTreeView_DeleteAll($TreeView1)
_GUICtrlTreeView_BeginUpdate($TreeView1)
Dim $addfld, $RS, $num
$num = _accessCountRecords($adSource, $coTable)
$hItem = _GUICtrlTreeView_Add($TreeView1, 0, "全部(" & $num & ")")
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $adSource)
$RS = ObjCreate("ADODB.Recordset")
$RS.ActiveConnection = $addfld
$RS.Open("Select 公司名称 From " & $coTable)
While Not $RS.eof And Not $RS.bof
If @error = 1 Then ExitLoop
_GUICtrlTreeView_AddChild($TreeView1, $hItem, $RS.Fields(0).value)
$RS.movenext
WEnd
$RS.movenext
$RS.close
$addfld.Close
_GUICtrlTreeView_Expand($TreeView1)
_GUICtrlTreeView_EndUpdate($TreeView1)
EndFunc ;==>_getCompanyTree
|
|