How can I show menu hints in the StatusBar?
Applies To: C++Builder 1 or higher
Category: Knowledge Base

-
- Start a new project using File | New Application.
-
- Add a Menu. Insert some sample items and edit their
- respective Hint.
-
- Add a StatusBar. Set SimplePanel to true.
-
- Edit the header file your form and insert:
-
- private:
- void __fastcall DisplayHint(TObject *);
-
- Double-click the OnCreate event of your form:
-
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- Application->OnHint = DisplayHint;
- Application->ShowHint = true;
- }
-
- Insert in your source code:
-
- void __fastcall TForm1::DisplayHint(TObject *Sender)
- {
- StatusBar1->SimpleText = Application->Hint;
- }
-
- Hints
- · If you're using C++Builder 4 or greater, you don't need these steps. Simply set the AutoHint property of your StatusBar to true.
C++Builder Developer's Network
Copyright © Yoto Yotov