水木子
发表于 2010-6-30 17:08:41
回复 13# afan
还是前辈的代码够强大{:face (411):}
afan
发表于 2010-6-30 17:12:40
回复 16# 水木子
我只是在你的代码基础上稍加装饰而已 {:face (355):}
410521a
发表于 2010-6-30 18:55:48
这个代码我基本上都看不懂
nmgwddj
发表于 2010-6-30 18:59:01
回复 3# 水木子
哎呀 生病了好啊 我都1年不知道生病啥滋味了{:face (411):}代码很帅 收藏
410521a
发表于 2010-6-30 19:05:21
回复 19# nmgwddj
这话可不能说``{:face (121):}
410521a
发表于 2010-6-30 19:45:35
分页后 查找 只能查找当前页面怎么办?
afan
发表于 2010-6-30 20:25:22
分页后 查找 只能查找当前页面怎么办?
410521a 发表于 2010-6-30 19:45 http://www.autoitx.com/images/common/back.gif
查找就到ini里面查找撒
410521a
发表于 2010-6-30 20:33:26
去INI中查找`要把listview清空吗? 如何清空?
afan
发表于 2010-6-30 22:08:42
回复 23# 410521a
_GUICtrlListView_DeleteAllItems($ListView1)
这样就清空了。再把你搜索到的重新 GUICtrlCreateListViewItem() 生成
131738
发表于 2010-6-30 23:49:43
回复 22# afan
武汉的。。。。。。。。。。。。
afan
发表于 2010-6-30 23:51:26
回复afan
武汉的。。。。。。。。。。。。
131738 发表于 2010-6-30 23:49 http://www.autoitx.com/images/common/back.gif
??? 夜深了,前辈讲梦话了 {:face (394):}
410521a
发表于 2010-7-1 13:35:07
我修改的` $Combo怎么不管用了?
afan
发表于 2010-7-1 13:38:18
回复 27# 410521a
我怎么知道你怎么修改的……
410521a
发表于 2010-7-1 14:04:15
$vas = IniReadSection($udata, '数据库')
If @error Then
MsgBox(48, "出错!", "数据库中还没有数据,系统为你添加了临时数据!"&@CRLF&"请重新运行程序")
IniWrite($udata,"数据库","测试","测试|测试|测试|添加数据后方可删除|此行,否则会出错!")
Exit
EndIf
Dim $iChange = 50, $dqyc = 1 ;$iChange 每页显示多少个项目;$dqyc 为当前页次
Dim $zys = Ceiling($vas / $iChange)
Dim $zys1 = Ceiling($vas)
上边的代码我放到脚本的最上边
form1
............
form2
........
$Form5 = GUICreate("数据库管理", 483, 354,-1,-1,BitOR($WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetIcon(@TempDir & "\ico.ico", -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$ListView5_1 = GUICtrlCreateListView("姓名|姓别|证件类型|证件编号|地址", 23, 24, 439, 230)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 235)
_GUICtrlListView_SetExtendedListViewStyle($ListView5_1, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES));,复选框 $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 63)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 130)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 132)
$Label5_4 = GUICtrlCreateLabel("1", 104, 269, 15, 17, 0x0002)
GUICtrlCreateLabel('/' & $zys, 119, 269, 24, 17)
$Combo5_1 = GUICtrlCreateCombo("", 219, 266, 59, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Combodata = ''
For $i = 1 To $zys
$Combodata &= '第' & $i & '页|'
Next
GUICtrlSetData(-1, $Combodata, '第1页')
$Button = GUICtrlCreateButton("首页", 36, 264, 43, 25)
$Button = GUICtrlCreateButton("<", 79, 264, 22, 25)
$Button = GUICtrlCreateButton(">", 145, 264, 23, 25)
$Button = GUICtrlCreateButton("尾页", 168, 264, 43, 25)
$Button = GUICtrlCreateButton("复制", 298, 264, 51, 25)
$Button = GUICtrlCreateButton("刷新", 35, 296, 75, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button = GUICtrlCreateButton("删除", 211, 296, 75, 25)
$Button = GUICtrlCreateButton("修改", 123, 296, 75, 25)
$Button = GUICtrlCreateButton("搜", 422, 296, 27, 25)
$Input5_1 = GUICtrlCreateInput("", 298, 298, 121, 21)
$Label5_1 = GUICtrlCreateLabel("数据:", 370, 270, 36, 17)
$Label5_2 = GUICtrlCreateLabel("0", 406, 270, 40, 16)
$Label5_3 = GUICtrlCreateLabel("By:陈伟东QQ:36951881", 298, 330, 164, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState(-1, $GUI_DISABLE)
Dim $Form5_AccelTable = [["{enter}", $Button],["{NUMPADADD}", $Button]]
GUISetAccelerators($Form5_AccelTable)
....................................
Func GUICtrlMsg()
Switch @GUI_CtrlId
Case $Combo5_1 ;下拉选择页次
Go(StringRegExpReplace(GUICtrlRead($Combo5_1), '[^\d]', ''))
EndSwitch
EndFunc
................................................
Func Go($yc)
Local $iNo1 = ($yc - 1) * $iChange + 1
Local $iNo2
If $yc = $zys Then
$iNo2 = $vas
SetState(64, 128, 64, 128)
ElseIf $yc = 1 Then
$iNo2 = $iNo1 + $iChange - 1
SetState(128, 64, 128, 64)
Else
$iNo2 = $iNo1 + $iChange - 1
SetState(64, 64, 64, 64)
EndIf
Read($iNo1, $iNo2)
GUICtrlSetData($Label5_4, $yc)
GUICtrlSetData($Combo5_1, '第' & $yc & '页')
$dqyc = $yc
EndFunc ;==>Go
Func SetState($1, $2, $3, $4)
GUICtrlSetState($Button, $1)
GUICtrlSetState($Button, $2)
GUICtrlSetState($Button, $3)
GUICtrlSetState($Button, $4)
EndFunc ;==>SetState
Func Read($iNo1, $iNo2)
$z = 0+$zys1
_GUICtrlListView_DeleteAllItems($ListView5_1)
For $i = $iNo1 To $iNo2
GUICtrlCreateListViewItem($vas[$i], $ListView5_1)
GUICtrlSetData($Label5_2,$z)
Next
EndFunc ;==>Read
410521a
发表于 2010-7-1 14:05:58
我晕` 我回复的贴又带关键字`了`` 快帮我审核下``帮我看看