Sign in to follow this  
Followers 0
Seminko

Input Box vertical center

5 posts in this topic

Hey fellas,

I'm creating a GUI where the input box has the same color as a colored strip behind it. And I can't find out how to center the the chars verticaly.

Even though there is a lot of free space on top, when I try to decrease the input box height the characters get clipped from the bottom.

tkbJilQ.jpg

I'm running:

$Input1 = GUICtrlCreateInput("", 280, 105, 40, 28, BitOR($ES_CENTER, $ES_NUMBER), $WS_EX_TRANSPARENT)
GUICtrlSetFont(-1, 19, 400, 0, "Krutofont") 

There will be a GUICtrlSetBkColor for the white space to be merged with the darker strip. I left it white for the issue to be more visible.

Any ideas?

Thanks

Seminko

Share this post


Link to post
Share on other sites



try to incorporate the $SS_CENTERIMAGE style (from StaticConstants.au3):

BitOR($ES_CENTER, $SS_CENTERIMAGE, $ES_NUMBER)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

try to incorporate the $SS_CENTERIMAGE style (from StaticConstants.au3):

BitOR($ES_CENTER, $SS_CENTERIMAGE, $ES_NUMBER)

Hello orbs, unfortunately there is no difference with or without Centerimage.

Edited by Seminko

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

indeed. i've been using this for labels, but apparently it does not work for Input/edit controls.

EDIT: there is this workaround:

'?do=embed' frameborder='0' data-embedContent>>

but perhaps the easiest way would be to fit the Input control height according to the height of the font.

Edited by orbs

Share this post


Link to post
Share on other sites

Shame. Well, I made a compromise and made the font smaller, which doesn't look as good but at least it is more centered.

Thanks for trying though.

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