找回密码
 加入
搜索
查看: 7395|回复: 11

[GUI管理] ListView控件如何冻结第一列

  [复制链接]
发表于 2012-3-22 23:22:44 | 显示全部楼层 |阅读模式
如图所示的ListView控件,怎样才能冻结第一列,使得拖动水平滚动条时第一列不动?

本帖子中包含更多资源

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

×
发表于 2012-3-23 01:07:14 | 显示全部楼层
p侠写过一个冻结项的,试试看转到列上用
发表于 2012-3-23 15:11:50 | 显示全部楼层
拖动水平滚动条时第一列不动?
那岂不是类似于按钮之类的控件吗?
发表于 2012-3-23 19:14:50 | 显示全部楼层
lst控件产生$LVN_BEGINDRAG 通知消息时,判断列
 楼主| 发表于 2012-3-23 21:02:10 | 显示全部楼层
本帖最后由 xms77 于 2012-3-26 12:15 编辑

回复 3# zxxputian6
上面的软件界面是用Delphi编写的,没有源码,我想用AU3来实现,界面差不多完成了,就是界面的细节,比如listview的列冻结还没有找到方法来实现。AU3代码如下,供参考
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=E:\autoit3\my program\Gramload program\GUI\Testing Data.kxf
$Form1 = GUICreate("Child_Form", 480, 320, 192, 124)
$Label1 = GUICtrlCreateLabel("Model", 8, 10, 33, 17)
$Label2 = GUICtrlCreateLabel("O/P#", 8, 35, 31, 17)
$Input_EN = GUICtrlCreateInput("", 48, 99, 105, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetState(-1, $GUI_DISABLE)
$Input_SBR = GUICtrlCreateInput("", 48, 118, 105, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetState(-1, $GUI_DISABLE)
$Input_Fix = GUICtrlCreateInput("", 48, 140, 105, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetState(-1, $GUI_DISABLE)
$Input_TMode = GUICtrlCreateInput("", 48, 162, 105, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetState(-1, $GUI_DISABLE)
$Input_SN = GUICtrlCreateInput("", 48, 184, 105, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
$Input1 = GUICtrlCreateInput("", 48, 230, 401, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
GUICtrlSetState(-1, $GUI_DISABLE)
$Label3 = GUICtrlCreateLabel("Cell#", 8, 57, 28, 17)
$Label4 = GUICtrlCreateLabel("M/C#", 8, 79, 32, 17)
$Label5 = GUICtrlCreateLabel("E/N", 8, 102, 24, 17)
$Label6 = GUICtrlCreateLabel("SBR#", 8, 122, 33, 17)
$Label7 = GUICtrlCreateLabel("Fix#", 8, 144, 24, 17)
$Label8 = GUICtrlCreateLabel("TMode", 7, 166, 38, 17)
$Label9 = GUICtrlCreateLabel("S/N", 8, 188, 24, 17)
$Label10 = GUICtrlCreateLabel("Mode", 8, 211, 31, 17)
$Label11 = GUICtrlCreateLabel("Txt Dir", 6, 233, 43, 17)
$Label12 = GUICtrlCreateLabel("Previous NPQ Path", 8, 256, 104, 17)
$Input2 = GUICtrlCreateInput("No Process Qualification", 111, 251, 337, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
$Input3 = GUICtrlCreateInput("No Process Qualification", 111, 272, 337, 21, BitOR($GUI_SS_DEFAULT_INPUT,$WS_BORDER))
$Label13 = GUICtrlCreateLabel("NPQ Path", 8, 275, 84, 17)
$Label14 = GUICtrlCreateLabel("Status", 8, 298, 42, 17)
$ListView_data = GUICtrlCreateListView("|Last1|Last2|Last3|3Range|3Avg|N Total|N Fail|Yield|CPK|Mean|Std.|Min.|Max.", 156, 6, 241, 217, BitOR($GUI_SS_DEFAULT_LISTVIEW,$WS_HSCROLL), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 50)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 5, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 6, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 7, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 8, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 9, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 10, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 11, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 12, 60)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 13, 60)
$ListView_data_0 = GUICtrlCreateListViewItem("Result", $ListView_data)
$Pic_Status = GUICtrlCreatePic("E:\autoit3\my program\图标库\Ready.bmp", 408, 8, 65, 65)
$Btn_Test = GUICtrlCreateButton("Test", 408, 80, 65, 25, BitOR($BS_CENTER,$BS_VCENTER))
$Btn_Retest = GUICtrlCreateButton("Retest", 408, 109, 65, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
$Btn_Cancel = GUICtrlCreateButton("Cancel", 409, 137, 64, 24)
$Lbl_Second = GUICtrlCreateLabel("0.0", 411, 165, 41, 16, $SS_CENTER, $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 800, 0, "Small Fonts")
$Label15 = GUICtrlCreateLabel("Sec.", 450, 166, 26, 17)
$Label16 = GUICtrlCreateLabel("NWK. OK", 408, 200, 59, 20, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Lbl_Stauts = GUICtrlCreateLabel("Put the Serial Number!", 48, 297, 426, 17, $SS_CENTER, $WS_EX_CLIENTEDGE)
$Pic_PathStauts = GUICtrlCreatePic("E:\autoit3\my program\图标库\Green Lamp.bmp", 454, 232, 17, 17)
$Pic1 = GUICtrlCreatePic("E:\autoit3\my program\图标库\Grey Lamp.bmp", 454, 252, 17, 17)
$Pic2 = GUICtrlCreatePic("E:\autoit3\my program\图标库\Grey Lamp.bmp", 454, 272, 17, 17)
$Lbl_Mode = GUICtrlCreateLabel("", 48, 206, 106, 25, BitOR($SS_RIGHT,$WS_BORDER), $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Lbl_MC = GUICtrlCreateLabel("", 48, 74, 106, 25, BitOR($SS_RIGHT,$WS_BORDER), $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Lbl_Cell = GUICtrlCreateLabel("", 48, 51, 106, 25, BitOR($SS_RIGHT,$WS_BORDER), $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Lbl_OP = GUICtrlCreateLabel("", 48, 27, 106, 25, BitOR($SS_RIGHT,$WS_BORDER), $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Label17 = GUICtrlCreateLabel("Venus_4HD", 48, 4, 106, 25, BitOR($SS_RIGHT,$WS_BORDER), $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

本帖子中包含更多资源

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

×
 楼主| 发表于 2012-3-23 21:04:45 | 显示全部楼层
回复 4# user3000
你是说可以用按钮控件来代替第一列?
 楼主| 发表于 2012-3-23 21:05:36 | 显示全部楼层
回复 5# 298311657
没有明白啥意思,能不能详细说说,谢谢!
发表于 2012-3-23 21:18:44 | 显示全部楼层
本帖最后由 afan 于 2012-3-23 21:51 编辑

不知道在 $WM_NOTIFY 消息里处理得了不
$LVN_BEGINSCROLL 消息
发表于 2012-3-25 23:58:17 | 显示全部楼层
$WM_NOTIFY 通知中的$LVN_BEGINDRAG消息
如果是需要冻结的列,那就直接返回,不要让系统自动处理
发表于 2012-4-19 07:56:46 | 显示全部楼层
现在正需要这个问题的解决方法,可惜没有答案 !
发表于 2012-4-24 13:33:06 | 显示全部楼层
不会呀,文本框和列表框都不一样的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-20 23:15 , Processed in 0.077943 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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