Link to home
Start Free TrialLog in
Avatar of Richard2000
Richard2000

asked on

Creating a button like IE's Go

Hi,

I'm using Delphi 4 Pro.  I would like to create a button similar to the Go button in IE (the button that appears to the right of the address combo box).  The button needs to have these properties:

* Consist of both a glyph and text.
* There should be no border shown, except for when the mouse pointer is moved over the button.
* When the mouse pointer is moved over the button, the glyph should change from grey (default state) to colour (hot state).
* The button must *not* be part of a TToolbar.  I intend to place the button either directly on a form or on a TCoolBar.

I've tried using TButton, TBitBtn and TSpeedButton, however none seem to be able to do all of the above.

Can a button with the above properties be created in Delphi 4 Pro?  Do later versions of Delphi (such as Delphi 7 Pro) have any enhanced button components for doing the above?

Thanks in Advance,

Richard
Avatar of ILE
ILE

i dont know for the button but u cen easily do that with other component
like the panel

put one panel on the form in this example panel2

set the bevelinear and bevelouter to false;

and put  this code in the  mosemove,mousedovn and  event



procedure TForm1.Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  panel2.bevelinner:=bvraised;
end;

procedure TForm1.Panel2MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  panel2.bevelinner:=bvlowered;
end;


{after that in the form mouse move do}
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
panel2.bevelinner:=bvnone;
end;


and you do what u wont arent you jut add code for one picture on the panel2 what u mey show hide or what u wont

and yes procedure TForm1.Panel2MouseDown
is the supstitution for buttonclick

you see just 3 easy commands :))

ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard2000

ASKER

Hi,

Thanks for the code.  I was just wondering if there was any way of creating such a button using the standard buttons components in the VCL that come with Delphi?

It is possible to create such a button as a button on a TToolBar in Delphi 4 Pro.  However, the TToolBar is intended for creating groups of buttons and I just need one button on its own that isn't part of a TToolBar.

Thanks in Advance,

Richard