gfuchao 发表于 2011-5-30 02:12:17

listview居中



怎么让listview标题文字居中显示!
感谢!

komaau3 发表于 2011-5-30 02:46:32

#Include <GuiListView.au3>
_GUICtrlListView_AddColumn($hWnd, $sText[, $iWidth = 50[, $iAlign = -1[, $iImage = -1[, $fOnRight = False]]]])

参数

$hWnd
控件句柄
$sText
列标题文本
$iWidth
列宽(象素)
$iAlign
标题栏与子项文本对齐方式 0 - 左对齐 1 - 右对齐 2 - 居中对齐
$iImage
图像列内的图像索引(从 0 开始)
$fOnRight
如果为真, 列内图像显示在文本的右边
&nbsp;

返回值

成功: 新列索引
失败: -1

gfuchao 发表于 2011-5-30 03:17:25

#Include
_GUICtrlListView_AddColumn($hWnd, $sText[, $iWidth = 50[, $iAlign = -1[, $iImage = -1[, $ ...
komaau3 发表于 2011-5-30 02:46 http://www.autoitx.com/images/common/back.gif
不行阿
难倒是我的用法错误?
贴上代码,看下吧
$ListView1 = GUICtrlCreateListView("身份证|日期 ", 16, 16, 650, 361, "", BitOR(0x00000020, 0x00000001))
_GUICtrlListView_AddColumn($listview1,"","",-1)

komaau3 发表于 2011-5-30 03:40:55

回复 3# gfuchao

可不是你错了嘛
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
$Form1 = GUICreate("Form1", 263, 219, 192, 114)
$ListView1 = GUICtrlCreateListView("", 8, 16, 250, 190)
_GUICtrlListView_AddColumn($ListView1,"电话",100,2,0)
_GUICtrlListView_AddColumn($ListView1,"身份证",150,2,1)
GUISetState(@SW_SHOW)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

gfuchao 发表于 2011-5-30 17:07:28

回复gfuchao

可不是你错了嘛
komaau3 发表于 2011-5-30 03:40 http://www.autoitx.com/images/common/back.gif

太感谢你了,两个头疼的问题你都帮我搞定了。
真是没钱,有钱肯定给你加钱
哎,总之Thank

nerdpal 发表于 2011-6-6 09:34:27

回复 4# komaau3

正好用的着,多谢

pusofalse 发表于 2011-6-6 17:19:51

回复 5# gfuchao


    论坛有评分功能,每个人都可以给别人评分,这不会影响自己的积分。
页: [1]
查看完整版本: listview居中