Jump to content

Listview checkbox on the right side


phonk
 Share

Recommended Posts

  • Moderators

phonk,

Best I can do is reversing the whole ListView: :graduated:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()

    GUICreate("Reversed Listview", 220, 250)

    Local $hListView = GUICtrlCreateListView("col1      |col2|col3", 10, 10, 200, 150, -1, $WS_EX_LAYOUTRTL) ; Reverse the GUI
    _GUICtrlListView_SetExtendedListViewStyle(GUICtrlGetHandle($hListView), $LVS_EX_CHECKBOXES)

    GUICtrlCreateListViewItem("item2|col22|col23", $hListView)
    GUICtrlCreateListViewItem("item1|col12|col13", $hListView)
    GUICtrlCreateListViewItem("item3|col32|col33", $hListView)

    GUISetState()

    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    WEnd

EndFunc   ;==>Example

Any use? :(

M23

P.S. Got the Local in there for you this time. :D

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

phonk,

Best I can do is reversing the whole ListView: :graduated:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()

    GUICreate("Reversed Listview", 220, 250)

    Local $hListView = GUICtrlCreateListView("col1      |col2|col3", 10, 10, 200, 150, -1, $WS_EX_LAYOUTRTL) ; Reverse the GUI
    _GUICtrlListView_SetExtendedListViewStyle(GUICtrlGetHandle($hListView), $LVS_EX_CHECKBOXES)

    GUICtrlCreateListViewItem("item2|col22|col23", $hListView)
    GUICtrlCreateListViewItem("item1|col12|col13", $hListView)
    GUICtrlCreateListViewItem("item3|col32|col33", $hListView)

    GUISetState()

    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    WEnd

EndFunc   ;==>Example

Any use? :(

M23

P.S. Got the Local in there for you this time. :D

Thanks for the Local ;-)

That would be an option, thanks.

Is there a chance to get the colums left aligned, when the Listview is reversed ?

Link to comment
Share on other sites

  • 11 months later...

I happened to find another solution for this. Just thought to share with the community.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
Opt('MustDeclareVars', 1)
Example()
Func Example()
    GUICreate("Reversed Listview", 220, 250)
    Local $hListView = GUICtrlCreateListView("|col1|col2|col3", 10, 10, 200, 150, -1) ; I put blank for the checkbox-header's text
    _GUICtrlListView_SetExtendedListViewStyle(GUICtrlGetHandle($hListView), BitOR($LVS_EX_GRIDLINES,$LVS_EX_CHECKBOXES))
_GUICtrlListView_SetColumnOrder($hListView, "1|2|3|0");Set the order so the checkbox column is on the right side
    GUICtrlCreateListViewItem("|1|col22|col23", $hListView)
    GUICtrlCreateListViewItem("|2|col12|col13", $hListView)
    GUICtrlCreateListViewItem("|3|col32|col33", $hListView)
    GUISetState()
    While 1
        If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    WEnd
EndFunc   ;==>Example
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...