Sign in to follow this  
Followers 0
AngelofDeath

..

5 posts in this topic

#1 ·  Posted (edited)

Posted Image Edited by AngelofDeath

Share this post


Link to post
Share on other sites



AngelofDeath,

To get grid lines to show on a ListView, you have to set the background colour to something other than the default. Does this produce what you want? :graduated:

#include <GUIConstantsEx.au3>
#include <ListviewConstants.au3>

$hGUI = GUICreate("Test", 500, 500)

$listview_1 = GUICtrlCreateListView("A|B|C|D|E|F|G|H",  10, 10, 250, 250, -1, $LVS_EX_GRIDLINES)
GUICtrlSetBkColor(-1, 0xE0E0E0)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

AngelofDeath,

LOL, what'chu talkin' 'bout, Melba23?

If I create a ListView using the $LVS_EX_GRIDLINES extended style, either with or without added items, I only get to see gridlines when I colour the background of the control. No doubt it is something to do with my monitor and Windows colour settings. :graduated:

To get grid lines to show on a ListView, you have to add a ListViewItem

Not so. The gridlines appear regardless of whether or not the ListView has content. :(

Anyway, I am delighted my attempt to help caused you such amusement. Perhaps if you had made your original question a litle clearer we could both have saved some wear and tear on our typing fingers. :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That's interesting; I often forget that things don't always look or work the same for everyone. Could it be OS related? I'm on XP Pro SP3.

To be honest, I'm sorry I asked this question in the first place. Before this topic, my line of thought was that I couldn't get the ListView to look the way I wanted because I didn't know how to do it. Now I know the real reason is because of a forced style that I can't do anything about. This pisses me off a bit because I see no reason for it. I was happy not knowing.

you are mixing window ex styles with listview ex styles in the last param

the result is you are adding WS_EX_DLGMODALFRAME and $WS_EX_TRANSPARENT to WS_EX_CLIENTEDGE window ex style

use LVM_SETEXTENDEDLISTVIEWSTYLE message for listview extended styles

#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <ListviewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>


Global $iExStyle = BitOR($WS_EX_CLIENTEDGE, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES)
ConsoleWrite('!iExStyle = 0x' & Hex($iExStyle, 8) & @crlf)

$iExStyle = BitOR($WS_EX_CLIENTEDGE, $WS_EX_DLGMODALFRAME, $WS_EX_TRANSPARENT)
ConsoleWrite('!iExStyle  = 0x' & Hex($iExStyle, 8) & @crlf)

GUICreate("ListViews", 530, 270)
; Deafault ListView
Global $listview_1 = GUICtrlCreateListView("A|B|C|D|E|F|G|H",  10, 10, 250, 250, -1, $WS_EX_CLIENTEDGE)
_GUICtrlListView_SetExtendedListViewStyle($listview_1,  $LVS_EX_FULLROWSELECT)

; Deafault ListView with Grid Lines
Global $listview_2 = GUICtrlCreateListView("A|B|C|D|E|F|G|H", 270, 10, 250, 250, -1, $WS_EX_CLIENTEDGE)
_GUICtrlListView_SetExtendedListViewStyle($listview_2,  BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES))

; Add a ListViewItem to each ListView
GUICtrlCreateListViewItem("1|2|3|4|5|6|7|8", $listview_1)
GUICtrlCreateListViewItem("1|2|3|4|5|6|7|8", $listview_2)
GUISetState()

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd
Edited by rover

I see fascists...

Share this post


Link to post
Share on other sites

rover,

Thanks for that - my (first) learning point of the day. :graduated:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0