Solved

how do i get the next speed button?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
searching for DavidI's "Mobile Summer School download" 3 128
Run video youtube webbrowse 10 57
Delphi 2 46
Graphics32 under Delphi 10.1 Berlin 2 34
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

20 Experts available now in Live!

Get 1:1 Help Now