ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set the text align property of each individual column on UserForm1.ListBox1.ColumnCount = 5 (https://www.excelbanter.com/excel-programming/343421-set-text-align-property-each-individual-column-userform1-listbox1-columncount-%3D-5-a.html)

Drom

Set the text align property of each individual column on UserForm1.ListBox1.ColumnCount = 5
 



Hi!

I have a UserForm "UserForm1"
This Userform has a ListBox "UserForm1.ListBox1"
This ListBox's, ClumnCount = 5, "UserForm1.ListBox1.ColumnCount = 5"

Now is it possible:
To set the text align property of each individual column ??

Kind of:
UserForm1.ListBox1.TextAlign = fmTextAlignRight
UserForm1.ListBox1.Column(3).TextAlign = fmTextAlignLeft
UserForm1.ListBox1.Column(5).TextAlign = fmTextAlignCenter

THANKS!!




Norman Jones

Set the text align property of each individual column on UserForm1.ListBox1.ColumnCount = 5
 
Hi Drom,

Now is it possible:
To set the text align property of each individual column ??


The individual columns do not have an alignment property. The ListBox's
AlignText property sets the alignment for all columns.


---
Regards,
Norman

"Drom" wrote in message
...



Hi!

I have a UserForm "UserForm1"
This Userform has a ListBox "UserForm1.ListBox1"
This ListBox's, ClumnCount = 5, "UserForm1.ListBox1.ColumnCount = 5"

Now is it possible:
To set the text align property of each individual column ??

Kind of:
UserForm1.ListBox1.TextAlign = fmTextAlignRight
UserForm1.ListBox1.Column(3).TextAlign = fmTextAlignLeft
UserForm1.ListBox1.Column(5).TextAlign = fmTextAlignCenter

THANKS!!





Leith Ross[_75_]

Set the text align property of each individual column on UserForm1.ListBox1.ColumnCount = 5
 

Hello Drom & Norman,

Just a side note. In Visual Basic 6.0 it would be possible because the
control has a window handle property (hWnd). Using the Applications
Programming Interface (API) you can control the individual alignments.
Unfortunately, this isn't the case in VBA.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=478123



All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com