Solved

how do i get the next speed button?

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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