[quote] I want to change the cursor to a pointing hand when the cursor is over the hyperlink text[/quote]
It might serve you to look at this article I posted...
http://www.delphipages.com
Main Topics
Browse All TopicsI have a form with a hyperlink to a web page and that works just fine. I want to change the cursor to a pointing hand when the cursor is over the hyperlink text. I originally had a simple label and the OnClick worked just fine for the hyperlink but there was no OnEnter/Exit for the label to control the cursor.
So I put the text in a tight-fitting panel which does have those events. The code for those events is:
procedure TfrmMainForm.Panel1Enter(S
begin
Screen.Cursor := crHandPoint;
end;
procedure TfrmMainForm.Panel1Exit(Se
begin
Screen.Cursor := crDefault;
end;
The problem is that when I move the cursor over the panel, the OnEnter routiine is not triggered and the cursor stays the same.
What do I need to do to trigger both of the routines?
Thanks,
John Fistere
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
[quote] I want to change the cursor to a pointing hand when the cursor is over the hyperlink text[/quote]
It might serve you to look at this article I posted...
http://www.delphipages.com
Thanks, Ed,
I saw your article when I was first starting out. It seemed a little complicated to me. I ultimately found the following code in the D5 help system:
procedure TfrmMainForm.lbHyperlinkCl
var
HTML_File: string;
begin
HTML_File := 'http://www.<-------------
ShellExecute(Handle, 'open', PChar(HTML_File),
nil, nil, SW_SHOW);
end;
What wasn't clear initially was that I had to add ShellApi to the uses statement. It seems to work fine. Does your solution do something else special?
John Fistere
No objections.
JFistere,
The OnEnter/OnExit for the panel only occurs when a control contained in the panel or the panel itself RECEIVES FOCUS.
To get an OnMouseEnter/OnMouseLeave solution, you have to follow the solution I proposed. This would allow you
to also change the font color/style when the cursor is over the label which you cannot do by just setting the cursor
property of the label.
Business Accounts
Answer for Membership
by: JFisterePosted on 2007-01-28 at 17:43:00ID: 18416439
Never mind!
As is often the case, once I ask the question, I figure out the answer. It's true in many areas of life. One of the best ways to find something is to buy a replacement.
Anyway, I found I don't need OnEnter/Exit. All I had to do was set the Cursor property of the panel to crHandPoint. It works just fine.
I am still surprised that the program would not enter the OnEnter routine, though.
Cheers,
John Fistere