views:

161

answers:

2

I have a TDBEdit that is not enabled and thus not showing the Hint.
What would be the best way to have it display the Hint while staying disabled?

+1  A: 

The only thing I can think of is overlaying the TDBEdit with a fully transparent control that has ShowHint set to True and a Hint property set.

Ritsaert Hornstra
That's more or less the workaroound I'm currently using with a graphic control just underneath the disabled TDBEdit...
François
I agree, it is simply a dirty hack, but disabled controls never will popup hints. Just another idea to not disable the control but play with the colors and set the readonly property?
Ritsaert Hornstra
A: 

Drop your disabled TWinControl (TDBEdit is a TWinControl) onto an enabled TWinControl container (a TPanel for example) and set the TPanel hint to the desired value.

AlexV
I prefer the more lightweight approach of a TGraphicControl (no window handle, no change in Parenthood)
François
Yeah but I find my way less "dirty" than an invisible control over the grid :)
AlexV
You actually probably aren't using a window handle just to have a grid on it. I did some tests to see what the limit was on handles but I ran out of memory first. Handles was a concern back in Windows 95 and 98.
Jim McKeeth