How to show Vista style balloon hints in Delphi?

后端 未结 3 697
谎友^
谎友^ 2021-02-03 13:50

On input validation, I\'m using balloon tips instead of message boxes. My problem is that on Vista, they have the old XP style with the rounded corners, not the newer more recta

3条回答
  •  孤独总比滥情好
    2021-02-03 14:10

    If you're using Delphi 2009, then adding balloon hints is reasonably straightforward, although the documentation is poor. (surprise, surprise)

    • Drop a TBalloonHint on your form
    • Drop a TImageList to contain icons if needed.
    • Link the TIMageList to the TBalloonHint
    • Set the form's CustomHint property to the TBalloonHint
    • Make sure ShowHint and ParentCustomHint are set true for your controls.

    This next bit is very non-obvious:

    • Format the "Hint" property of your control as "Title|Hint|ImageIndex"

    You're done. This doesn't look 100% vista-like, maybe due to font choice. But it's pretty close.


    (source: codegear.com) ,

提交回复
热议问题