Display Hint on a disabled GRID

Asked

Viewed 234 times

2

Good afternoon,

I have an application in Delphi that has a grid with two columns, the first column being the "question" and the second column the "answer". This grid has 8 lines and each line has a "hint", that is, when I place the mouse on a line, a "balloon" is displayed with a brief explanation of the question.

This GRID has 3 modes: inclusion, alteration and visualization. When GRID is in include and change mode, that is, when it is editable, the hint appears normally. However, when you are in view mode, the grid is disabled (to prevent change) and the hint is not displayed.

I believe it is something native to Delphi, which disables the hint whenever the grid is disabled (enable = false).

I wonder if there’s any way to change that. Is there a command in Delphi that causes the hint of each field to be displayed when the grid is disabled?

From now on, thank you.

  • 1

    You leave the grid as Enable=False?... because you do not leave Dbgrid as Enable=True and change its Readonly so your hint should work.

  • @Jeffersonrudolf, thank you for your reply! I tried this way and the hint appeared, but since there are some options of grid response that are of type "list", the user can change them even in READ_ONLY mode. If you have any other ideas to keep the grid disabled and make the hint appear, please let me know. Again: thanks.

  • @tfa has no way to display hint on a disabled component, you will need to use another approach. Which "grid" are you using? Stringgrid, Dbgrid, etc.?

  • @Guybrush I’m using Dbgrid.

  • @tfa, besides setting the Readonly property to true, you are making Dbgrid1.Options := Dbgrid1.Options - [dgEditing] ?

1 answer

1

I don’t think there’s any way to show it Hint on disabled components.

I needed something like this years ago...and I found in a forum a way around the situation and it’s quite simple.

You will mask the grid. Places your grid within one panel, and size of panel you define the size of the grid. Then you disable the grid and active the panel with the hint of grid.

  • 1

    Do as it is in the answer will work... if you need to remove the edges of the panel not to get extra edges on grid the size of panel is the size that would be yours grid then define the grid with alClient...

  • 1

    If the answer served mark with accepted

Browser other questions tagged

You are not signed in. Login or sign up in order to post.