Without an additional Gadget, you can change the (vertical) margins with "EM_SETRECT". This works only with multiline edit controls, but you can use a multiline gadget for one line too.
There is an example at RSbasic's winapi library:
http://www.rsbasic.de/aktualisierung/wi ... trieren.pb
P.S.: Don't mix windows styles between different controls
TextGadget = static control = static style = #SS_CENTER (not #ES_CENTER)
StringGadget = edit control = edit style = #ES_CENTER
Center Align String - OS Version specific issue?
Re: Center Align String - OS Version specific issue?
sorry for my bad english
Re: Center Align String - OS Version specific issue?
Aye... I am using a string gadget + #es_center.Josh wrote: P.S.: Don't mix windows styles between different controls
TextGadget = static control = static style = #SS_CENTER (not #ES_CENTER)
StringGadget = edit control = edit style = #ES_CENTER
Re: Center Align String - OS Version specific issue?
Hi Josh
Hi jassing
#ES_CENTER = 1
#SS_CENTER = 1
So both are identical
With #EM_SETRECT you can adjust left,right,top & bottom margins as you mentioned
But it will not suit you dynamically like #SS_CENTER if you changed the text for any reason
And for center the text vertically it will be again a headache if you Resized the gadget
But it still a good idea
Hi jassing
#ES_CENTER = 1
#SS_CENTER = 1
So both are identical

With #EM_SETRECT you can adjust left,right,top & bottom margins as you mentioned
But it will not suit you dynamically like #SS_CENTER if you changed the text for any reason
And for center the text vertically it will be again a headache if you Resized the gadget
But it still a good idea
Egypt my love
-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: Center Align String - OS Version specific issue?
how to make this vertical center with #PB_String_Password? this #PB_String_Password not liked #ES_MULTILINE flag 

-
- Enthusiast
- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: Center Align String - OS Version specific issue?
and the second problem: when font of gadget is more than 10pt - this code is didn't work
how to fix this? this and that problem with password style

how to fix this? this and that problem with password style