![]() |
|
#1
|
|||
|
|||
|
Can I show a hint (yellow bar style, NOT statusbar style) when a user hoovers over a certain title column of a dbgrid ?
|
|
#2
|
|||
|
|||
|
You will need to create a descendent component (from TDBGrid) and write your own command message (easier said then done)
type TXDBGrid = class(TDBGrid) private procedure CMHintShow(var Msg : TMessage); message CM_HINTSHOW; end; procedure TXDBGrid.CMHintShow(var Msg: TMessage); begin //write here end; If you are a delphi novice, I recommend you find a TDBGrid component (Freeware, shareware, commercial) which has the feature already. UnSysApps |
|
#3
|
|||
|
|||
|
Just set the ShowHint=True for grid (or better for parent form) and use the Hint property of grid to specify the hint text
If you use the TSMDBGrid, you may also include the eoCellHint flag in ExOptions property( to display the long texts from field as hint) or use the HintField property/OnCellHint event (to change the hint text depends from current record) With best regards, Mike Shkolnik http://www.scalabium.com |
|
#4
|
|||
|
|||
|
I thin kI can do something like this:
procedure TForm1.SMDBGrid4MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin TSMDBGrid(Sender).Hint := 'test'; end; but how can use different hints for different column titles ? |
|
#5
|
|||
|
|||
|
never mind, found it
for reference:var pt: TGridcoord; begin pt:= SMDBGrid4.MouseCoord( x, y ) ; if (pt.y=0) and (pt.X=1) then TSMDBGrid(Sender).Hint := 'test'; end; |
|
#6
|
|||
|
|||
|
Yeah, but that does not show it in a Yellow Bar!
If you wanted just the standard hint drawn, then we could have helped ya sooner! <SMILE> UnSysApps |
![]() |
| Thread Tools | |
| Display Modes | |
|
|