Is it possible to change ToolStripMenuItem tooltip font?

后端 未结 3 1169
南旧
南旧 2021-01-12 06:40

I have a dynamically filled ContextMenuStrip where each ToolStripMenuItem has a formatted text for the tooltip. And, in order for this text to make sense to the user, I must

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-12 06:51

    You could create a custom ToolTip class (CustomToolTip) that inherits from ToolTip. Then you would have to handle the OnDraw event. Inside that event you can change the font.

    Look here for an example (there is a vb and c# example).

    EDIT

    You would have to handle the rendering of the custom tooltip on your own (IE: OnMouseOver, OnMouseLeave events of the toolstripmenuitem). You might be able to create a customtoolstripmenuitem that uses a custom tooltip, but I'm not sure that toolstripmenuitem exposes a tooltip propety/object.

提交回复
热议问题