Jump to content

How to center and size GUICtrlCreateListView


Recommended Posts

I am trying to adjust my top column so the column topics are centered and using a bigger font.  However, whenever I use a bigger font the columns stay the same size and I just get a ",,,"

Does anyone know how to stretch the columns to use the entire box, center it, and increase the font size?  Thanks for any help.

#include <Misc.au3>
#include <Excel.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUICreate("Indications", 410, 280, 590, 85, -1, $WS_EX_ACCEPTFILES) ; Size of box
    GUISetBkColor(0x00E0FFFF) ; will change background color
    Local $idListview = GUICtrlCreateListView("   Column    |    Item   |   PCI   |   IDE   ", 5, 5, 395, 210) ;,$LVS_SORTDESCENDING)
    GUICtrlSetFont($idListview, 12)
    ;GUICtrlSetFont($idListview, 18)  ; Font size I would like to use
    Local $idButton = GUICtrlCreateButton("Close", 150, 220, 90, 55) ; CLOSE BUTTON
    Local $idItem1 = GUICtrlCreateListViewItem("item211|col22|col23|col34", $idListview)
    Local $idItem2 = GUICtrlCreateListViewItem("test111|test31|test5|test6", $idListview)
    GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; to allow drag and dropping
    GUISetState(@SW_SHOW)
    ;GUICtrlDelete($idItem1)

    ; Loop until the user exits.
    While 1
        Switch GUIGetMsg()

            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $idButton
                ExitLoop

            Case $idListview


        EndSwitch
    WEnd

 

Link to comment
Share on other sites

Thanks for the help!  Sadly I still have one problem.  That line only stretched the first column, "Column" but did not do the rest for "Item", ""PCI", and "IDE".

I tried reading through the _GUICtrlListView_SetColumnWidth parameters and example but couldn't figure out where I was going wrong.

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

×
×
  • Create New...