Jump to content

Input Box vertical center


Go to solution Solved by Seminko,

Recommended Posts

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

Link to comment
Share on other sites

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

BitOR($ES_CENTER, $SS_CENTERIMAGE, $ES_NUMBER)

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...