Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Prompts not displaying
Hi there,
Just wondering what causes subclassed editfields to not display the prompts correctly.
By not displaying correctly, I mean displaying only the first letter followed by an ellipsis.
I have places where it works and places where it doesn't.
I have not spent any time debugging this so just throwing the line out early.
Will provide a screenshot if this is unfamiliar territory.
Thanks
Just wondering what causes subclassed editfields to not display the prompts correctly.
By not displaying correctly, I mean displaying only the first letter followed by an ellipsis.
I have places where it works and places where it doesn't.
I have not spent any time debugging this so just throwing the line out early.
Will provide a screenshot if this is unfamiliar territory.
Thanks
Comments
However, here's what it looks like and a quick review seems to show that the problem exists only where I leave the default properties alone. In the screenshot you'll see I've changed the prompt fontcolour to red and the font to bold for some and they all work as expected. The one below them that was just left as is doesn't display correctly.
So you are saying that the improperly functioning prompt is using the same style settings as the others? So the problem extends beyond the text being clipped?
Let's try to isolate the issue this way:
No on all counts.
The improperly functioning prompt occurs because it was written by an improperly functioning coder.
The red ones worked because I was setting the font to a bold font.
The others I thought I was leaving as default but was inadvertently setting the font to a value of zero.
Complete the if then else statement and everything works as advertised.
Strange that I wrote that back in 2011 and not a single user has mentioned it.
Don't worry, have given myself an uppercut. ;-)
They are using version 3.0.0 of the subclass control and with that version, setting the font value of the prompt property to zero is the same as leaving it null and relying on the default.
So somewhere between 3.0.0 and the current version of the control, changes have occurred so that setting the font value to zero now truncates the prompt itself.
Not a bad thing because it forces me to code more correctly but I suspect it is one of those things that just slipped in there.