Solved

how do i get the next speed button?

Posted on 1998-02-15
5
149 Views
Last Modified: 2010-04-04
how do i check for the next speed button in my coolbar?
some of my speedbuttons are disabled and enabled
and i want to check if the speedbutton is enabled then
there will be a message in the status bar else
there will be no message when u move to the next disabled button and there will be a message if u move to the next
enabled button ..  
0
Comment
Question by:superboy
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
inter earned 10 total points
ID: 1359266
1 - To display a message on a status bar you sould supply the OnHint event handler for Application.OnHint. Say you have a panel called StatusBar:
  procedure Form1.FormCreate(Sender:TObject);
  begin
    ...
    Application.OnHint := MyHint;
    ...
  end;

  procedure Form1.MyHint(Sender:TObject);
  begin
    StatusBar.Caption := Application.Hint;
  end;

2 - You should fill the Hint property of your speed buttons as follows:(on designer)
   Hint  = 'Brief action string|The string you want to appear in status base';
  for example
   CloseBtn.Hint := 'Close|This button closes the form';

Ok?
Igor
0
 

Author Comment

by:superboy
ID: 1359267

it always shows no matter whether the buttons are enabled or disabled. how do i disable the hints when the buttons are disabled
and vice versus..?
0
 
LVL 5

Expert Comment

by:inter
ID: 1359268
Then add this to OnHint:

if Form1.ActiveControl.Enabled then
   StatusBar.Caption := Application.Hint;

Igor
0
 

Author Comment

by:superboy
ID: 1359269
ActiveControl gets only the control that has focus on the form
which is not i want..i want controls that has the enabled property set to false...
i try the code and my app crash...

0
 
LVL 5

Expert Comment

by:inter
ID: 1359270
This code is a traditional one and It should not make your app crash! If you want hint not to be displayed if a control is disabled either use:

In OnHint:

 if Form1.ActiveControl <> nil then
    if Form1.ActiveControl.Enabled then
       StatusBar.Caption := Application.Hint;

Or

 if (Sender is TButton) and (TButton(Sender).Enabled)then
    StatusBar.Caption := Application.Hint;

Thats all!

Igor
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now