The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: jtsceioa on September 17, 2009, 10:47:11 PM

Title: Centering text within the statusbar
Post by: jtsceioa on September 17, 2009, 10:47:11 PM
Hi,

I am having trouble aligning text within the status bar. 

My status bar is split into 5 parts and I would like to center the text within each part.

Looking through MSDN, there was mention of embedding tab characters (\ t) into the text.  When I tried it, I didn't get much success.

Can someone please advise.

Thanks

Jan
Title: Re: Centering text within the statusbar
Post by: jtsceioa on September 18, 2009, 04:52:06 PM
It's ok, I've worked it out.

I was too tired last night, and completely forgot to translate high-level syntax into ASCII character codes.

Just in-case someone might want to know in the future, place the number 9 (ASCII code for horizontal tab) before the text string to center it, e.g

DefaultStatusText   db      9,"Just Some Text",0

Title: Re: Centering text within the statusbar
Post by: hutch-- on September 18, 2009, 09:33:13 PM
Jan,

Ther4e is another approach but a bit more work, place a STATIC control on the status bar using the status bar as its parent, use MoveWindow() to centre the STATIC control on the status bar and set the text in the STATIC control to centre alignment.
Title: Re: Centering text within the statusbar
Post by: jtsceioa on September 19, 2009, 12:33:19 AM
Thanks Hutch

I'll give it a go.

Regards

Jan