找回密码
 加入
搜索
查看: 7678|回复: 16

[AU3基础] 关于GUICtrlCreateListView之每个列的宽度最多能达25个字符

 火.. [复制链接]
发表于 2012-11-27 08:40:01 | 显示全部楼层 |阅读模式
本帖最后由 boyhong 于 2012-11-27 09:07 编辑

关于GUICtrlCreateListView之每个列的宽度最多能达25个字符.
GUICtrlCreateListView的帮助里有一句:“每个列的宽度最多能达25个字符

实际证明,GUICtrlCreateListViewItem确实在上边的列表视图ID上显示不了完整文本。。。。。请问大家是如何让其完整显示的啊?谢谢啦~~~

如下边二楼的例子:
本来的:
....................................................................................................................................................................................................................................................................item1
最后只显示一些点点,而把item1截了~~~
 楼主| 发表于 2012-11-27 08:48:46 | 显示全部楼层
FOR Example:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
        Local $listview, $button, $item1, $item2, $item3, $msg

        GUICreate("listview items", 820, 250, 100, 200, -1, $WS_EX_ACCEPTFILES)
        GUISetBkColor(0x00E0FFFF) ; will change background color

        $listview = GUICtrlCreateListView("col1  |col2|col3  ", 10, 10, 600, 150);,$LVS_SORTDESCENDING)
        $button = GUICtrlCreateButton("Value?", 75, 170, 670, 20)
        $item1 = GUICtrlCreateListViewItem("item2|col22|col23", $listview)
        $item2 = GUICtrlCreateListViewItem("....................................................................................................................................................................................................................................................................item1|col12|col13", $listview)
        $item3 = GUICtrlCreateListViewItem("item3|col32|col33", $listview)
        GUICtrlCreateInput("", 20, 200, 150)
        GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping
        GUISetState()
        GUICtrlSetData($item2, "|ITEM1")
        GUICtrlSetData($item3, "||COL33")
        GUICtrlDelete($item1)

        Do
                $msg = GUIGetMsg()

                Select
                        Case $msg = $button
                                MsgBox(0, "listview item", GUICtrlRead(GUICtrlRead($listview)), 2)
                        Case $msg = $listview
                                MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
                EndSelect
        Until $msg = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

评分

参与人数 1金钱 +30 贡献 +1 收起 理由
afan + 30 + 1 举报广告借地加分

查看全部评分

 楼主| 发表于 2012-11-27 10:58:54 | 显示全部楼层
谢谢A大的评份,举报广告,举手之劳,为了环境整洁,人人有责!更为感谢论坛的管理人员处理这些垃圾。。。
发表于 2012-11-27 11:48:17 | 显示全部楼层
$item2 = GUICtrlCreateListViewItem("1234567890abcdefghijklmnopqrstuvwxyzitem1_1234567890abcdefghijklmnopqrstuvwxyzitem2_1234567890abcdefghijklmnopqrstuvwxyzitem3_1234567890abcdefghijklmnopqrstuvwxyzitem4_1234567890abcdefghijklmnopqrstuvwxyzitem5_1234567890abcdefghijklmnopqrstuvwxyzitem6二百五十九个字符|col12|col13", $listview)
测试可以显示259个字符,一般够用了吧。其实超过100个就不方便了,要拉好长,不如ToolTip显示或在悬停时在其它Label显示
发表于 2012-11-27 13:48:59 | 显示全部楼层
回复 4# afan
afan这是过瘾呢吧
发表于 2012-11-27 14:05:32 | 显示全部楼层
回复  afan
afan这是过瘾呢吧
netegg 发表于 2012-11-27 13:48



    是啊~ 楼主的“.”有260个,是不是更过瘾呢
 楼主| 发表于 2012-11-27 14:17:42 | 显示全部楼层
回复 6# afan


    我躺着也中枪啦~~~

回正题:采集了本机安装的软件名称,放进去,实际情况是:一般电脑上安装的软件有三十个左右,名称字符相加远超这个个数啊~~~
发表于 2012-11-27 14:20:53 | 显示全部楼层
...一般电脑上安装的软件有三十个左右,名称字符相加远超这个个数啊~~~
...
boyhong 发表于 2012-11-27 14:17



    莫非它们都挤在一格Item里面……
发表于 2012-11-27 15:54:08 | 显示全部楼层
回复 7# boyhong


    为什么不是一个软件一个Item呢??加起来好看些吗???
发表于 2012-11-27 16:45:08 | 显示全部楼层
回复 1# boyhong

_GUICtrlListView_SetColumnWidth($hListView, 0, 1322)

    可以完整显示259个字符
发表于 2012-11-27 22:22:38 | 显示全部楼层
怎么才能自动设置宽度来显示文本?
发表于 2012-11-27 22:24:03 | 显示全部楼层
回复 10# annybaby
_GUICtrlListView_SetColumnWidth($hListView, 0, 1322)
后面的1322能不能改为一个参数,让列宽自动根据内容调整?
发表于 2012-11-27 22:37:41 | 显示全部楼层
回复 12# blue_dvd

看帮助啊,亲~~自己动手,丰衣足食~~
发表于 2012-11-27 23:36:02 | 显示全部楼层
回复 13# annybaby
你不觉得有个高手或经验丰富的解释一下更爽些吗!
发表于 2012-11-27 23:40:21 | 显示全部楼层
回复 14# blue_dvd


    我非常同意你的观点,我也是很希望别人指点下~~
不过对于F1马上就有答案的,我不太好意思问人
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-8 16:51 , Processed in 0.089801 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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