Jump to content

How Can I Align Data Within A Guictrlcreatelistview ?


Recommended Posts

I have been trying to align data within GUICtrlCreateListViewItem without sucess. As you can see from my example, how can I make the AMOUNT column be right aligned, and if possible, how can I make the TYPE column centered?

Here is some sample code...

#include <GuiConstants.au3>

GUICreate("test data alignment",800,200, 100,200,-1,)
GUISetBkColor (0x00E0FFFF) ; will change background color

$listview = GUICtrlCreateListView ("NAME           |TYPE  |AMOUNT   |OTHER  ",10,10,780,180);,)

$item1=GUICtrlCreateListViewItem("First Name|A|1000000|32",$listview)
$item2=GUICtrlCreateListViewItem("Second Name|B|600000|35",$listview)
$item3=GUICtrlCreateListViewItem("etc.|B|600000|35",$listview)
$item4=GUICtrlCreateListViewItem("|B|400000|35",$listview)
$item5=GUICtrlCreateListViewItem("|B|3000|35",$listview)
$item6=GUICtrlCreateListViewItem("|B|250000|35",$listview)
$item7=GUICtrlCreateListViewItem("|B|79000|35",$listview)
$item8=GUICtrlCreateListViewItem("|B|480000|35",$listview)
$item9=GUICtrlCreateListViewItem("|B|37000|35",$listview)

GUISetState()
GUICtrlSetData($item2,"||55555|",);this changes data in the specified location

Do
  $msg = GUIGetMsg ()

Until $msg = $GUI_EVENT_CLOSE

Thanks for any suggestions :think:

"I've seen your work in the past, and it's novice at best..." SmOke_N
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...