Solved

how do i get the next speed button?

Posted on 1998-02-15
5
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
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 …

749 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