Sign in to follow this  
Followers 0
Automan Empire

How Can I Align Data Within A Guictrlcreatelistview ?

2 posts in this topic

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

Share this post


Link to post
Share on other sites



Requires beta

_GUICtrlListViewJustifyColumn($h_listview, $i_col[, $i_justification=0])

$i_justification

0 = Left (default)

1 = Right

2 = Center


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0