How can I show a tooltip on a disabled button?

后端 未结 4 749
臣服心动
臣服心动 2020-12-03 00:40

If you have a disabled button on a winform how can you show a tool-tip on mouse-over to inform the user why the button is disabled?

4条回答
  •  半阙折子戏
    2020-12-03 01:26

    Place the button (or any control that fits this scenario) in a container (panel, tableLayoutPanel), and associate the tooltip to the appropriate underlying panel cell. Works great in a number of scenarios, flexible. Tip: make the cell just large enough to hold the bttn, so mouseover response (tooltip display) doesn't appear to "bleed" outside the bttn borders.

提交回复
热议问题