找回密码
 加入
搜索
查看: 3075|回复: 9

菜鸟求高手解答GUICtrlCreateListView问题

  [复制链接]
发表于 2010-5-21 17:05:39 | 显示全部楼层 |阅读模式
本帖最后由 小凯 于 2010-5-21 20:32 编辑

很简单的一个小程序,我能做到这里已经很不容易了,希望能给解答
问题就在于我点击通过之后,系统方式那一条要求显示系统注册,我不知道该怎么写,望高手解答!!!
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\桌面\ce.kxf
$Form1_1 = GUICreate("Form1", 621, 198, 192, 114)
$Input1 = GUICtrlCreateInput("帐号", 16, 24, 121, 21)
$Input2 = GUICtrlCreateInput("", 17, 53, 121, 21)
$ListView2 = GUICtrlCreateListView("帐号|密码|系统方式", 384, 24, 225, 137)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 75)
$Button1 = GUICtrlCreateButton("提交", 64, 96, 57, 33)
$ListView1 = GUICtrlCreateListView("帐号|密码", 144, 24, 177, 137)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100)
$Button2 = GUICtrlCreateButton("通过→", 328, 72, 49, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $a = GUICtrlRead($Input1)
                        $b = GUICtrlRead($Input2)
                GUICtrlCreateListViewItem($a & "|" & $b,$ListView1)
        Case $Button2
                GUICtrlCreateListViewItem(GUICtrlRead(GUICtrlRead($ListView1) & "|系统注册" ),$ListView2)
        EndSwitch
WEnd
发表于 2010-5-21 18:10:06 | 显示全部楼层
#include <GuiListView.au3>
#include <WindowsConstants.au3>

$Form1_1 = GUICreate("Form1", 621, 198, 192, 114)
$Input1 = GUICtrlCreateInput("帐号", 16, 24, 121, 21)
$Input2 = GUICtrlCreateInput("", 17, 53, 121, 21)
$ListView2 = GUICtrlCreateListView("帐号|密码|系统方式", 384, 24, 225, 137)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 75)
$Button1 = GUICtrlCreateButton("提交", 64, 96, 57, 33)
$ListView1 = GUICtrlCreateListView("帐号|密码", 144, 24, 177, 137)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100)
$Button2 = GUICtrlCreateButton("通过→", 328, 72, 49, 33)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case - 3
                        Exit
                Case $Button1
                        $a = GUICtrlRead($Input1)
                        $b = GUICtrlRead($Input2)
                        GUICtrlCreateListViewItem($a & "|" & $b, $ListView1)
                Case $Button2
                        $aItem = _GUICtrlListView_GetSelectedIndices($ListView1, True)
                        If UBound($aItem) > 1 Then
                                $sText = _GUICtrlListView_GetItemTextString($ListView1, $aItem[1])
                                GUICtrlCreateListViewItem($sText & '|' & '系统注册', $ListView2)
                        EndIf
        EndSwitch
WEnd
 楼主| 发表于 2010-5-21 18:31:02 | 显示全部楼层
回复 2# 水木子
再请教个问题!!
帐号密码通过的时候,帐号保留密码自动更改为“密码已隐藏”该怎么写,借用一下这个程序问下。
具体是  
帐号 密码  允许通过  帐号 密码已隐藏  系统注册
望解答!!!!!!!!!!!!
不胜感激
发表于 2010-5-21 18:41:32 | 显示全部楼层
将上面我给的代码 第25行 改成
$b = StringRegExpReplace(GUICtrlRead($Input2), '.', '*')
 楼主| 发表于 2010-5-21 20:13:19 | 显示全部楼层
回复 4# 水木子

大哥!我表达失误..
Case $Button2
                        $aItem = _GUICtrlListView_GetSelectedIndices($ListView1, True)
                        If UBound($aItem) > 1 Then
                                $sText = _GUICtrlListView_GetItemTextString($ListView1, $aItem[1])
                                GUICtrlCreateListViewItem($sText & '|' & '系统注册', $ListView2)

我的意思是在$ListView2 这行里 更改为“密码已隐藏”
发表于 2010-5-21 20:19:53 | 显示全部楼层
是这样吗?
#include <GuiListView.au3>
#include <WindowsConstants.au3>

$Form1_1 = GUICreate("Form1", 621, 198, 192, 114)
$Input1 = GUICtrlCreateInput("帐号", 16, 24, 121, 21)
$Input2 = GUICtrlCreateInput("", 17, 53, 121, 21)
$ListView2 = GUICtrlCreateListView("帐号|密码|系统方式", 384, 24, 225, 137)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 80)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 75)
$Button1 = GUICtrlCreateButton("提交", 64, 96, 57, 33)
$ListView1 = GUICtrlCreateListView("帐号|密码", 144, 24, 177, 137)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 70)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 100)
$Button2 = GUICtrlCreateButton("通过→", 328, 72, 49, 33)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case - 3
                        Exit
                Case $Button1
                        $a = GUICtrlRead($Input1)
                        $b = GUICtrlRead($Input2)
                        GUICtrlCreateListViewItem($a & "|" & $b, $ListView1)
                Case $Button2
                        $aItem = _GUICtrlListView_GetSelectedIndices($ListView1, True)
                        If UBound($aItem) > 1 Then
                                $sText = _GUICtrlListView_GetItemText($ListView1, $aItem[1], 0)
                                GUICtrlCreateListViewItem($sText & '|密码已隐藏|' & '系统注册', $ListView2)
                        EndIf
        EndSwitch
WEnd
 楼主| 发表于 2010-5-21 20:30:56 | 显示全部楼层
谢谢!!达到我的想法了,.谢谢!! 我看帮助看了几个小时了,试验了N次,都没达到这效果!
亏就亏咱不懂英语啊!哎!!!
发表于 2010-5-21 20:41:56 | 显示全部楼层
本帖最后由 水木子 于 2010-5-21 20:51 编辑

回复 7# 小凯
老实说我也不懂E文 ^_^
发表于 2010-5-21 23:23:02 | 显示全部楼层
回复 7# 小凯

来这里下载中文的UDF帮助

http://autoitx.com/forum.php?mod ... 4&highlight=api

下载完之后,给第一个文件名修改为autoit3udf.7z.001,第二个改为改名为autoit3udf.7z.002,然后下个7zip解压缩工具, 地址在这里:http://sparanoid.com/lab/7z/
然后,在autoit3udf.7z.001上点右键,选7-zip,Extract Here,解压出来就是汉化版的UDF了,看起来就不吃力了。
 楼主| 发表于 2010-5-22 07:54:31 | 显示全部楼层
回复 9# lanfengc


    谢谢了!!收藏了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-18 15:16 , Processed in 0.082359 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表