找回密码
 加入
搜索
查看: 1963|回复: 1

[系统综合] 如何改变listview中,某一个具体的单元格所对应的 字体颜色 和单元格的背景颜色?

[复制链接]
发表于 2016-4-12 02:06:38 | 显示全部楼层 |阅读模式
本帖最后由 fenhanxue 于 2016-4-12 02:12 编辑
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>

   Local $hImage, $hListView

    ; 创建界面
    GUICreate("列表中添加项目", 400, 300)
    $hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
    GUISetState()

    ; 添加列
    _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
    _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
    _GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

    ; 添加项目
    _GUICtrlListView_AddItem($hListView, "A1")
        _GUICtrlListView_AddSubItem($hListView,0,'A2',1)
        _GUICtrlListView_AddSubItem($hListView,0,'A3',2)
        
    _GUICtrlListView_AddItem($hListView, "B1")
        _GUICtrlListView_AddSubItem($hListView,1,'B2',1)
        _GUICtrlListView_AddSubItem($hListView,1,'B3',2)

    ; 循环至用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()


如上图所示,
问题1.如何把 B2 的字体颜色变成红色?(其他单元格不变,都还是图片中显示的这样黑色

问题2.如何把 B2 这个单元格的背景颜色变成红色? (其他单元格颜色保持不变,还是图中默认的白色)

即:

本帖子中包含更多资源

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

×
发表于 2016-4-12 16:30:44 | 显示全部楼层
回复 1# fenhanxue

看看这个有用否:

    https://www.autoitscript.com/for ... -16/#comment-867799

本帖子中包含更多资源

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

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-2 16:10 , Processed in 0.075989 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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