Jump to content

ListView styling help


Steveiwonder
 Share

Recommended Posts

Hi all,

I'm trying to create a list view that looks like this but failing everytime, i can't find the right styles etc...

Posted Image

Here is what i have...

#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>

Global $ListView, $Form1

$Form1 = GUICreate("Update in progress", 633, 350, 192, 124)
$ListView = GUICtrlCreateListView("121", 104, 80, 353, 200, $ListView)

For $i = 0 to 40 Step +1
    GUICtrlCreateListViewItem("This is item " & $i, $ListView)
Next

GUISetState(@SW_SHOW)
sleep(3000)
Exit

(Example code, not real project)

I have tried different combination of styles without any luck.

Thanks in advance, S

Edited by Steveiwonder

They call me MrRegExpMan

Link to comment
Share on other sites

Changing your listview to a list looks more like the pic

#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>

Global $ListView, $Form1

$Form1 = GUICreate("Update in progress", 633, 350, 192, 124)
$ListView = GUICtrlCreateList("121", 104, 80, 353, 200, $WS_VSCROLL)

For $i = 0 to 40 Step +1
    GUICtrlSetData(-1,"This is item " & $i)
Next

GUISetState(@SW_SHOW)
sleep(3000)
Exit
Edited by Yoriz
GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
Link to comment
Share on other sites

Changing your listview to a list looks more like the pic

#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>

Global $ListView, $Form1

$Form1 = GUICreate("Update in progress", 633, 350, 192, 124)
$ListView = GUICtrlCreateList("121", 104, 80, 353, 200, $WS_VSCROLL)

For $i = 0 to 40 Step +1
    GUICtrlSetData(-1,"This is item " & $i)
Next

GUISetState(@SW_SHOW)
sleep(3000)
Exit

This is closer yes, i can use "$LBS_NOSEL" to remove selection but i still have a dotted gray outline round each one.

Can i remove this ?

Anyone from AutoIt able to comment if this is a custom install and how did you make it?

Edited by Steveiwonder

They call me MrRegExpMan

Link to comment
Share on other sites

I have used this instead... which seems to be better...

However how do i add scrolling or autoscrolling to a _GUICtrlListView_Create?

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)



Global $hListView

_Main()

Func _Main()

    Local $GUI
    $GUI = GUICreate("(UDF Created) ListView Create", 400, 300)

    $hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268, $LVS_NOCOLUMNHEADER + $LVS_LIST+ $WS_VSCROLL)
    GUISetState()

_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)
_GUICtrlListView_InsertItem($hListView, "Item 1", 0)



    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

Anyone have any idea?

Edited by Steveiwonder

They call me MrRegExpMan

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