找回密码
 加入
搜索
查看: 5380|回复: 7

[GUI管理] 关于ListView控件信息显示长度的问题!(已解决)

  [复制链接]
发表于 2010-3-7 12:53:47 | 显示全部楼层 |阅读模式
本帖最后由 nmgwddj 于 2010-3-7 13:18 编辑


我想设置“路径”的长度长一点如何做到。我这空格写多了“路径”后边就有... 不知所措 拓展样式里貌似没有相关内容

代码如下
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 347, 209, 152)
$TreeView1 = GUICtrlCreateTreeView(8, 72, 169, 265, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$ListView1 = GUICtrlCreateListView("名称               |路径                              ", 184, 72, 433, 265)
$run = GUICtrlCreateTreeViewItem("About", $TreeView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $run
                        MsgBox(0, '', "a")

        EndSwitch
WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-3-7 13:10:12 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 347, 209, 152)
$TreeView1 = GUICtrlCreateTreeView(8, 72, 169, 265, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$ListView1 = GUICtrlCreateListView("名称               |路径", 184, 72, 433, 265)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 270)
$run = GUICtrlCreateTreeViewItem("About", $TreeView1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $run
                        MsgBox(0, '', "a")

        EndSwitch
WEnd

评分

参与人数 1金钱 +20 收起 理由
nmgwddj + 20 非常感谢

查看全部评分

 楼主| 发表于 2010-3-7 13:18:00 | 显示全部楼层
GOOD 非常感谢!
发表于 2010-3-7 15:17:59 | 显示全部楼层
空格毕竟不是...
下面有两种比较正规的方法。我的收藏。

#Include <GuiListView.au3>
_GUICtrlListView_AddColumn($listview1, "任务", 150)
_GUICtrlListView_AddColumn($listview1, "状态", 50)

;已经有表头的情况下设置宽度
_GUICtrlListView_SetColumnWidth($ListView1, 0, 130);第一列
_GUICtrlListView_SetColumnWidth($ListView1, 1, 100);第二列
 楼主| 发表于 2010-3-7 16:43:17 | 显示全部楼层
感谢楼上的。你的代码也一样成功
发表于 2010-3-7 23:12:10 | 显示全部楼层
现在的论坛开始活跃起来了   支持
发表于 2011-3-13 08:27:10 | 显示全部楼层
谢谢了,楼上的仨位啊
发表于 2011-3-19 23:18:17 | 显示全部楼层
呵呵,路过
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-1 10:53 , Processed in 0.087500 second(s), 30 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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