Sign in to follow this  
Followers 0
jjohn

_GUICtrlListViewEnsureVisible

4 posts in this topic

I'm not sure if it's me not familiar with the beta version, I can't get the return to 1(TRUE), it is always 0(False) when the specific list item is visible, the help about this is not producing some visual result.

Does it suppose to cause scrolling or have to combine with _GUICtrlListViewScroll to scroll to specific list item

please help

Share this post


Link to post
Share on other sites



I'm not sure if it's me not familiar with the beta version, I can't get the return to 1(TRUE), it is always 0(False) when the specific list item is visible, the help about this is not producing some visual result.

Does it suppose to cause scrolling or have to combine with _GUICtrlListViewScroll to scroll to specific list item

please help

some code that is producing these results would help, i suspect if it is already visible there may not be anything for it to do and it may return 0

It should have to be combined, have you tried the example in the help, you should see results of what is expected.

_GUICtrlListViewScroll doesn't scroll to a specific item, it scrolls in pixels horizontally and vertically


SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


Link to post
Share on other sites

thanks for your advise, I review the help and finally got it, my code is as following

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

Opt ('MustDeclareVars', 1)
Dim $listview, $Btn_Visible, $Btn_Exit, $msg, $GUI, $Combo, $Label, $Status, $ReturnData
$GUI = GUICreate("ListView Ensure Visible", 392, 200)

$listview = GUICtrlCreateListView("col0|col1|col2|col3", 40, 30, 310, 79,$LVS_SHOWSELALWAYS,BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_REGIONAL))
For $a = 0 To 9
    GUICtrlCreateListViewItem($a &"|line" & $a & "|data" & $a & "|more" & $a, $listview)
Next
$Label = GUICtrlCreateLabel("Pick an index to ensure visible",40,120)
$Combo = GUICtrlCreateCombo ("", 40,140) 
GUICtrlSetData(-1,"0|1|2|3|4|5|6|7|8|9","9") 
$Btn_Visible = GUICtrlCreateButton("Visible now", 200, 120, 90, 40)
$Btn_Exit = GUICtrlCreateButton("Exit", 300, 130, 70, 30)
$Status = GUICtrlCreateLabel("",2,175,388,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_Visible
            $ReturnData = _GUICtrlListViewEnsureVisible($listview,GUICtrlRead($Combo)*1,1)
        ;$ReturnData = _GUICtrlListViewEnsureVisible($listview,GUICtrlRead($Combo),1) won't work
        ;cause $i_index has to be a number not a string
            GUICtrlSetData($Status, 'Return from "_GUICtrlListViewEnsureVisible" is ' & $ReturnData)
    EndSelect
WEnd
Exit

I realized many $i_index in the help require numbers, not string of number.

thanks now i m done! :lmao:

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