Jump to content

Text in GuiCtrlCreateInput() control is invisible


Recommended Posts

A user with a ThinkPad T41p running Windows XP has reported that text in an input box (created with GuiCtrlCreateInput) is invisible on his system. Text that he enters is there, because is processed when he clicks the OK button on the form - but it is not displayed as he types.

In case it helps, here is the code for the offending item, but I cannot reproduce the issue myself. $s_1 is the initialisation string.

$i_GUIEntTxtItem = GUICtrlCreateInput($s_1, 60, 20, 290, 19, $ES_MULTILINE + $ES_AUTOVSCROLL)

GUICtrlSetBkColor($i_GUIEntTxtItem, 0xFFFFEE)

GUICtrlSetFont($i_GUIEntTxtItem, 9, 400, 0, "Verdana")

GUIRegisterMsg ($WM_COMMAND, "p_GUIEntTxtItem") ; direct message event

GUICtrlSetState($i_GUIEntTxtItem, $GUI_FOCUS)

This code works fine on other systems, and so far the issue is a unique case. Has anyone seen this before, or got any ideas on how I might debug it?

Best regards

Nick

Link to comment
Share on other sites

You changed the background-color for the edit, but you left the font-color be

default. Maybe he uses themes where the default font-color is close to what

you set the background-color to be.. ?

If you want to change the color then it's best to also change the font-color as

well. That should solve it.

Link to comment
Share on other sites

Thanks Helge, but this was not the cause.

What we found was that it works fine on systems with the desktop DPI set to 96, but does not work on systems with a DPI of 120. The cause was the height of the input box. Increasing it by 1 pixel allowed the text to also be displayed at 120 DPI. If the input box is not high enough, Windows will not display any characters at all, instead of only displaying truncated characters. So the minimum for broad compatibility is 20 pixels.

Best regards

Nick

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...