Jump to content

ListView /w Picture Background


Recommended Posts

To make this easier I have taking SS's, but I have blanked some information out for reasons, but still left the problem.

I am using a BMP for a background. To add a new entry to the ListView I use FileOpenDialog and the information returned from that is enetered in. But when adding multiple files. The below happens.

When the Column headers should look like

As you can see the background image is sometimes 'on top' of the listview and to 'fix' it you have to move the mouse over it.

I know its a common problem but can someone tell me how to fix it please:).

Edit: Removed above SS's, here's a better one.

Posted Image

Edited by Burrup

qq

Link to comment
Share on other sites

Hello Burrup,

I have tried to do a script like you have discribed, with bmp, listview ...

I have noticied, when I want to resize a column, that the event is "-8"

so, when $msg=-8, I refresh the listwiew by hiding it and showing it :

#include <GUIConstants.au3>

global $index=0

$gui=GuiCreate("GUI", 392, 320,(@DesktopWidth-392)/2, (@DesktopHeight-320)/2  )
$pic= GUICtrlCreatePic ("marbre.bmp", 0, 0, 392, 320)
GuiCtrlSetState(-1,$GUI_DISABLE)

$listview = GUICtrlCreateListView ("col1 |col2|col3  ",10,10,200,150)
$button = GUICtrlCreateButton ("Browse",75,170,70,20)
GUICtrlSetState(-1,$GUI_ACCEPTFILES)  ; to allow drag and dropping
GUISetState()
;_refresh()

Do
  $msg = GUIGetMsg ()
     
   Select
      Case $msg = $button
         _selectfile()
     case $msg=-8
         _refresh()
   EndSelect
Until $msg = $GUI_EVENT_CLOSE


Func _selectfile()
    $file=FileOpenDialog("file(s)","","(*.*)",4)
    if @error then Return
    $file=StringSplit($file,"|")
    for $ind=1 to $file[0]
        assign("item"&$index,GUICtrlCreateListViewItem($file[$ind]&"|index|"&$index,$listview))
        $index=$index+1
    Next
    _refresh()
EndFunc

Func _refresh()
    GUICtrlSetState($listview,$GUI_HIDE)
    GUICtrlSetState($listview,$GUI_SHOW)
EndFunc

I don't think,that it's the best way, but it fix the problem of resizing...

I hope it'll help you

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...