Jump to content

Horisontal Autoscroll In Listview


is8591
 Share

Recommended Posts

I found how to do vertical auto-scroll in ListView, but what about horisontal?

I know that Beta has this functionality, but I have to use the release version.

Also, while on the topic of ListView

Is it possible to fix 1st column to be visible at all times even when horisontal scrolling,

basically simulating Excel Freeze Pane?

Thanks

Link to comment
Share on other sites

I found how to do vertical auto-scroll in ListView, but what about horisontal?

I know that Beta has this functionality, but I have to use the release version.

Not tested, but what about $WS_HSCROLL style:

$ListView1 = GUICtrlCreateListView("Col1|Col2|Col3", 1, 1, 200, 200, BitOR($LVS_REPORT,$LVS_SINGLESEL,$LVS_SHOWSELALWAYS,$LVS_NOLABELWRAP,$WS_HSCROLL,$WS_VSCROLL,$WS_BORDER), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_FULLROWSELECT))

Edited by Zedna
Link to comment
Share on other sites

Not tested, but what about $WS_HSCROLL style:

This will give user Horisontal scroll bar. I need to scroll programatically when user clicks on buttons.

Something like what I found in MAGS post

const $LVM_ENSUREVISIBLE = 0x1013

GUICtrlSendMsg($listview, $LVM_ENSUREVISIBLE, $line, 0)

This will scroll vertically - I need horisontally

Link to comment
Share on other sites

$i_dx = Horizontal (pixels)

$i_dy = Vertical (pixels)

Global Const $LVM_FIRST = 0x1000
Global Const $LVM_SCROLL = ($LVM_FIRST + 20)

GUICtrlSendMsg($h_listview, $LVM_SCROLL, $i_dx, $i_dy)

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 comment
Share on other sites

$i_dx = Horizontal (pixels)

$i_dy = Vertical (pixels)

Global Const $LVM_FIRST = 0x1000
Global Const $LVM_SCROLL = ($LVM_FIRST + 20)

GUICtrlSendMsg($h_listview, $LVM_SCROLL, $i_dx, $i_dy)
Thanks a lot Gary.

Just 2 quick questions:

#1 - Anyway to scroll by rows and columns, and not pixels in report mode?

#2 - How do you figure out hex values for message commands?

Link to comment
Share on other sites

Thanks a lot Gary.

Just 2 quick questions:

#1 - Anyway to scroll by rows and columns, and not pixels in report mode?

#2 - How do you figure out hex values for message commands?

Look at LVM_GetNextItem message and LVNI_ABOVE / LVNI_BELOW flag

here is some C++ code from google (search LVNI_ABOVE):

UINT nLastItem = GetSelectedCount()
int nSelected = GetNextItem(nLastItem , LVNI_ABOVE | LVNI_SELECTED);
    while( nSelected != -1 )
    {
        DeleteItem(nSelected);
        nSelected = GetNextItem( nSelected, LVNI_ABOVE | LVNI_SELECTED);
    }

Here is MSDN description:

MSDN: GetNextItem

Here is my post with example of using TVM_xxx messages with TreeView:in AutoIt

UDF _TreeViewGetItemState

You can accomodate these informations/examples to your needs...

EDIT: for scrolling by rows use LVM_GETITEMRECT message to get Rect for listview item (get its height) and then use LVM_SCROLL with y = (number_of_items * item_height) in pixels as gafrost said

Edited by Zedna
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...