Jump to content

listview and gridlines


Recommended Posts

3.1.1.75

if gridlines are added to the extended style, works fine unless using the down/up arrows at the top and bottom of the scrollbar

#include <GuiConstants.au3>
#include <GuiListView.au3>

Opt ('MustDeclareVars', 1)
Dim $listview, $Btn_GetTop, $Btn_Exit, $msg, $Status
GUICreate("ListView Get Top Index", 392, 322)

$listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149)
;~ GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
;~ GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
;~ GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_TRACKSELECT, $LVS_EX_TRACKSELECT)
GUICtrlCreateListViewItem("line1|data1|more1", $listview)
GUICtrlCreateListViewItem("line2|data2|more2", $listview)
GUICtrlCreateListViewItem("line3|data3|more3", $listview)
GUICtrlCreateListViewItem("line4|data4|more4", $listview)
GUICtrlCreateListViewItem("line5|data5|more5", $listview)
GUICtrlCreateListViewItem("line6|data6|more6", $listview)
GUICtrlCreateListViewItem("line7|data7|more7", $listview)
GUICtrlCreateListViewItem("line8|data8|more8", $listview)
GUICtrlCreateListViewItem("line9|data9|more9", $listview)
GUICtrlCreateListViewItem("line10|data10|more10", $listview)
GUICtrlCreateListViewItem("line11|data11|more11", $listview)
GUICtrlCreateListViewItem("line12|data12|more12", $listview)
$Btn_GetTop = GUICtrlCreateButton("Get Top Index", 150, 230, 90, 40)
$Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)
$Status = GUICtrlCreateLabel("Remember items are zero-indexed", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
            ExitLoop
        Case $msg = $Btn_GetTop
            GUICtrlSetData($Status, "Top Index: " & _GUICtrlListViewGetTopIndex($listview))
    EndSelect
WEnd
Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to post
Share on other sites

Works fine when I drag the scroll button, but when I click the up and down arrows, I get extraneous lines (WinXP Classic Theme).

http://64.233.167.104/search?q=cache:ThUFh...2+problem&hl=en

<{POST_SNAPBACK}>

Whatever I dclick the updown I cannot reproduce it on my system.

I will recommend the Larry Post suggestion use as less as possible the grid. At least don't expect a very good repainting ;)

Link to post
Share on other sites

@jpm: do you plan now to implement the "SystemParametersInfo" (thanks Larry for info) to get it works right?

(BTW: I also switched it off so I couldn't reproduce it at frist ;) )

<{POST_SNAPBACK}>

It is not our responsibility to fix Microsoft's bugs. We should be trying to provide generic GUI building capabilities. We can not override user-specified features at the OS level. That is bad design. There are 3 solutions to this problem:
  • Live with it.
  • Turn off the feature at the OS level on your machine.
  • The script author can programmatically make the SystemParametersInfo call themselves (Although this is still bad UI design since it does not take the user's settings into consideration).
AutoIt should not be responsible for fixing this bug.
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...