Sign in to follow this  
Followers 0
boogieoompa

Listview scrolling problem

2 posts in this topic

So I have this function

Func FunPopulateListView($parse)
;GUICtrlCreateListViewItem("1|2|3|4|5|6|7|8|9|10",$mainlist)
$i = 1

While $Parse[$i] <> ""
$split = StringSplit($Parse[$i], "|")
$split2 = StringSplit($split[4],",")
Select

Case GUICtrlRead($childchkct) = 1 And $split2[1] = "CT"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkct) = 1 And $split2[2] = "CT"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkct) = 1 And $split2[3] = "CT"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkct) = 1 And $split2[4] = "CT"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkct) = 1 And $split2[5] = "CT"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkmr) = 1 And $split2[1] = "MR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkmr) = 1 And $split2[2] = "MR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkmr) = 1 And $split2[3] = "MR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkmr) = 1 And $split2[4] = "MR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkmr) = 1 And $split2[5] = "MR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist) 
Case GUICtrlRead($childchkus) = 1 And $split2[1] = "US"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkus) = 1 And $split2[2] = "US"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkus) = 1 And $split2[3] = "US"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkus) = 1 And $split2[4] = "US"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkus) = 1 And $split2[5] = "US"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist) 
Case GUICtrlRead($childchkxr) = 1 And $split2[1] = "XR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkxr) = 1 And $split2[2] = "XR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkxr) = 1 And $split2[3] = "XR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkxr) = 1 And $split2[4] = "XR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist)
Case GUICtrlRead($childchkxr) = 1 And $split2[5] = "XR"
    GUICtrlCreateListViewItem($Parse[$i],$mainlist) 
    
EndSelect
$i = $i + 1

WEnd
EndFunc

That populates a list view that is declared with

;List
Local $iExWindowStyle = BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE)
Local $iExListViewStyle = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER)
Global $mainlist = GUICtrlCreateListView("", 10, 90, $screenwidth - 20, $screenheight - 200, $iExWindowStyle)
_GUICtrlListView_SetExtendedListViewStyle($mainlist, $iExListViewStyle)

; Add column
_GUICtrlListView_AddColumn($mainlist, "Locked", 50)
_GUICtrlListView_AddColumn($mainlist, "Last Name", 200)
_GUICtrlListView_AddColumn($mainlist, "First Name", 200)
_GUICtrlListView_AddColumn($mainlist, "Modality", 100)
_GUICtrlListView_AddColumn($mainlist, "Status", 300)
_GUICtrlListView_AddColumn($mainlist, "Status Time", 100)
_GUICtrlListView_AddColumn($mainlist, "Total Time", 100)
_GUICtrlListView_AddColumn($mainlist, "Beverage", 100)
_GUICtrlListView_AddColumn($mainlist, "Notes", 1000)
_GUICtrlListView_AddColumn($mainlist, "PatientNum", 0)

The thing is my right scroll bar disappears if I don't have at least 1 GUICtrlCreateListViewItem out of the select statement. If I move GUICtrlCreateListViewItem($Parse[$i],$mainlist) (the exact same line as the select statement) the right scroll bar is there, but once I move it down 2 lines the right scroll bar disappears. Has anyone seen this before?

Thanks,

Share this post


Link to post
Share on other sites



Actually I just figured it out. My resize function had an extra piece of logic in it that it didnt need. I used one that I found in the forum

This one is a bit shorter and does the job.

Thanks!

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
 Local $iHeight, $iWidth
 $iWidth = BitAND($lParam, 0xFFFF) ; _WinAPI_LoWord
 $iHeight = BitShift($lParam, 16) ; _WinAPI_HiWord
 _WinAPI_MoveWindow($mainlist, 10, 90, $iWidth - 20, $iHeight - 200)
 Return $GUI_RUNDEFMSG
EndFunc

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