News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Centering text within the statusbar

Started by jtsceioa, September 17, 2009, 10:47:11 PM

Previous topic - Next topic

jtsceioa

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

jtsceioa

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


hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jtsceioa

Thanks Hutch

I'll give it a go.

Regards

Jan