Solved

how do i get the next speed button?

Posted on 1998-02-15
5
152 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 60
Base1 Encode/Decode 3 77
IdTCPClient and IdTCPServer exchanging data on desktops and not Android 11 115
DBGrid or StringGrid ? 6 89
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

777 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