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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
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(Sen
Y: Integer);
begin
panel2.bevelinner:=bvraise
end;
procedure TForm1.Panel2MouseDown(Sen
Shift: TShiftState; X, Y: Integer);
begin
panel2.bevelinner:=bvlower
end;
{after that in the form mouse move do}
procedure TForm1.FormMouseMove(Sende
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 :))