Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Menu
Wed, Apr 20 2016 3:43 AMPermanent Link

Godfrey

Ultimatesoft

Hi

I want to make a horizontal menu.  When the user hovers over the menu item(text) then a line appears under
the text to indicate they are on that item.  This is a popular method these days.  Can anyone give
me some suggestions, code snippets for EWB.

Thanks
Godfrey
Wed, Apr 20 2016 7:34 AMPermanent Link

Trinione

<< When the user hovers over the menu item(text) then a line appears under
the text to indicate they are on that item. >>

Godfrey:
For the hover effect you can use the MouseEnter and MouseLeave events:

procedure TForm1.Label1MouseEnter(Sender: TObject);
begin
 TLabel(Sender).Font.Style.Underline := true;
end;

procedure TForm1.Label1MouseLeave(Sender: TObject);
begin
 TLabel(Sender).Font.Style.Underline := false;
end;
Wed, Apr 20 2016 7:37 AMPermanent Link

Trinione

A TLink component is better than a TLabel in this case.
Wed, Apr 20 2016 9:26 AMPermanent Link

Godfrey

Ultimatesoft

Trinione wrote:

<<A TLink component is better than a TLabel in this case.>>

Thanks that works, but I would like a thicker underline, with a bit of a gap between the text and the line.  Any ideas

Godfrey
Wed, Apr 20 2016 9:59 AMPermanent Link

Uli Becker

Godfrey,

maybe this thread will help you:

http://tinyurl.com/jd7b326

Uli
Wed, Apr 20 2016 10:58 AMPermanent Link

Godfrey

Ultimatesoft

Uli Becker wrote:

<<maybe this thread will help you:

http://tinyurl.com/jd7b326>>

Yep that looks pretty good

Thanks
Wed, Apr 20 2016 12:18 PMPermanent Link

Trinione

<< Thanks that works, but I would like a thicker underline, with a bit of a gap between the text and the line.  Any ideas >>

I believe to do that you would need to create a new component using TLink as a base.
Image