Page 1 of 2
Missing gridline in LIG
Posted: Fri Sep 20, 2024 10:19 am
by Lord
Hi!
I noticed, after I switched from Win7 to Win11, that the gridline
between header and first line is missing. At least here.
Code: Select all
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ListIconGadget(1,10,10,480,230,"Titel",400,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
For a=1 To 5
AddGadgetItem(1,-1,"Item "+Str(a),0,0)
Next
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Is it only here or has anyone else this also noticed?
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 10:24 am
by boddhi
I don't have W11 but with W10, it's the same...
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 10:29 am
by Mijikai
Same for me on my Win 11
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 10:42 am
by BarryG
Doesn't show it on Win 10 either. Has it ever?
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 10:51 am
by RASHAD
Hi Lord
Workaround
Code: Select all
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ListIconGadget(1,10,10,480,230,"Titel",400,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetColumn(1, 1, "test",100)
header = SendMessage_(GadgetID(1), #LVM_GETHEADER,0,0 )
SetWindowTheme_(Header, "","BUTTON")
For a=1 To 5
AddGadgetItem(1,-1,"Item "+Str(a),0,0)
Next
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 12:41 pm
by Lord
Hi @all!
Thanks for confirmation.
BarryG wrote: Fri Sep 20, 2024 10:42 am
... Has it ever?
Not her on Win7.
@Rashad:
Thank you for the workaround.
But I think this is a little misleading, as it let you think you can
trigger some action if you klick on column header.
I this a bug?
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 12:48 pm
by RASHAD
Hi Lord
The Header still as is
The theme is just a skin nothing more
You can also disable the Modern XP theme if you like
No Bug as I know and remember
Just checked the snippet with Windows 7
You are right but because Windows 7 was using a proper theme(LinearGradient)
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 1:08 pm
by jacdelad
Hasnt this been always that way? Afaik it's a bug already confirmed a long time ago.
Anyway, there's another fix for Windows:
Code: Select all
SendMessage_(GadgetID(#MyLIG),#LVM_SETEXTENDEDLISTVIEWSTYLE,#LVS_EX_GRIDLINES,#LVS_EX_GRIDLINES)
Edit:
Found it:
https://www.purebasic.fr/german/viewtop ... 7&start=10, so it has been in since 4.51 at least.
And here:
viewtopic.php?t=54152
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 2:58 pm
by Lord
Hi!
It seems, that on Win11 nobody uses gridlines anymore.
So a missing first gridline is not detectable.
But if you have an empty LIG with some empty rows and gridlines on,
it looks like the header has double the height as a regular row.
And that looks ugly.
@jacdelad:
SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)
This doesn't solve this problem either. Same missing gridline.
I now think that it is a windows issue, not a PureBasic issue.
Thanks for help.
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 3:08 pm
by ebs
Code: Select all
SendMessage_(GadgetID(#MyLIG),#LVM_SETEXTENDEDLISTVIEWSTYLE,#LVS_EX_GRIDLINES,#LVS_EX_GRIDLINES)
When I use this (Win 11 Pro), it seems to make the
vertical grid lines a little bit darker and more noticeable, but the
horizontal line under the header row is still missing.
Does anyone else see this?
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 4:16 pm
by jacdelad
Lord wrote: Fri Sep 20, 2024 2:58 pm
@jacdelad:
SendMessage_(GadgetID(#MyListIcon), #LVM_SETEXTENDEDLISTVIEWSTYLE, #LVS_EX_GRIDLINES, #LVS_EX_GRIDLINES)
This doesn't solve this problem either. Same missing gridline.
You're right, I didn't notice that. It only gets fixed for older Windows versions.
How about:
for RASHADS code? I for one would prefer this, the BUTTON makes header look strange with the round corners and such.
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 4:22 pm
by ebs
How about:
SetWindowTheme_(Header, "","")
Plain text
for RASHADS code? I for one would prefer this, the BUTTON makes header look strange with the round corners and such.
Unfortunately, this doesn't do anything either.

Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 5:44 pm
by ChrisR
Lord wrote: Fri Sep 20, 2024 12:41 pm
@Rashad: ... But I think this is a little misleading, as it let you think you can
trigger some action if you klick on column header.
Maybe
Code: Select all
If OpenWindow(0,0,0,500,250,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ListIconGadget(1,10,10,480,230,"Titel",400,#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetColumn(1, 1, "test",100)
header = SendMessage_(GadgetID(1), #LVM_GETHEADER,0,0 )
;SetWindowTheme_(Header, "","BUTTON")
SetWindowTheme_(Header, "","")
SetWindowLongPtr_(header, #GWL_STYLE, GetWindowLongPtr_(header, #GWL_STYLE) &~ #HDS_BUTTONS)
For a=1 To 5
AddGadgetItem(1,-1,"Item "+Str(a),0,0)
Next
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 5:59 pm
by RASHAD
Hi ChrisR
No need to SetWindowLongPtr_(header, #GWL_STYLE, GetWindowLongPtr_(header, #GWL_STYLE) &~ #HDS_BUTTONS)
I keep saying that the themes is just a skin
If you don't like "BUTTON" skin
You can try
SetWindowTheme_(Header, "","TAB")
But I still advice with "BUTTON" because it's so close to the required action
Re: Missing gridline in LIG
Posted: Fri Sep 20, 2024 6:22 pm
by ebs
ChrisR,
Your code produces the best looking result on Win 11 IMHO.
The header row is clearly defined with a different color than the rest of the control and there are no "buttons" to click!
It also works fine with my standard trick of setting the header font to bold.
Thank you!