Jump to content

Recommended Posts

Posted
post-14759-1161517638_thumb.pngIs it possible to create a colored grid such as this using a GUIListview control? If not, any other suggestions would be appreciated. Thanks.
  • Moderators
Posted (edited)

post-14759-1161517638_thumb.pngIs it possible to create a colored grid such as this using a GUIListview control? If not, any other suggestions would be appreciated. Thanks.

What have you tried?

#include <GUIConstants.au3>

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

$listview = GUICtrlCreateListView ("col1  |col2|col3  ",10,10,200,150,-1, $LVS_EX_GRIDLINES)
$button = GUICtrlCreateButton ("Value?",75,170,70,20)
$item1=GUICtrlCreateListViewItem("item2|col22|col23",$listview)
$item2=GUICtrlCreateListViewItem("item1|col12|col13",$listview)
$item3=GUICtrlCreateListViewItem("item3|col32|col33",$listview)
$input1=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
        GUISetState(@SW_LOCK, $Main)
        GUICtrlSetBkColor($listview, 0xff0000)
        GUISetState(@SW_UNLOCK, $Main)
   EndSelect
Until $msg = $GUI_EVENT_CLOSE
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

I've tried reading the help file to see if there is any reference to color. There is none.

So GUICtrlSetBkColor and GUICtrlSetColor aren't references to GUI and Colors?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Thank you for your help. I should have been more clear. I'm trying to vary the color of the cells based on the value in the cells. I didn't see anything in the ListView help. I will probably have to take a different approach. I was only hoping to use ListView because it would save creating the grid by hand.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...