Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hyperlink...vb6

Posted on 2004-09-27
10
Medium Priority
?
837 Views
Last Modified: 2006-11-17
In Form load, I have:

txt1="jsmith@hotmail.com"

How can I make it appear as a hyperlink text?
0
Comment
Question by:Mike Eghtebas
[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
  • 6
  • 3
10 Comments
 
LVL 4

Expert Comment

by:avi247
ID: 12163199
Create a label Label1 on Form. Then add this code.

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Label1_Click()
ShellExecute hWnd, "open", "http://www.experts-exchange.com", vbNullString, vbNullString, conSwNormal
End Sub
0
 
LVL 26

Assisted Solution

by:EDDYKT
EDDYKT earned 400 total points
ID: 12163349
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12164503
avi247,

How do I make it appear like a hyperlink.  I am testing your code now.

Mike
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12164740
Hi avi247,

To test my computer settings, I pasted 'jsmith@hotmail.com' on a word document, as expected, it changed to a hyperlink.  Upon clicking on it, it launched outlook.
-------
Using your code, it gave me error on 'conSwNormal'
-------

btw, I had the exct user-defined function in use in my application which works fine and opens various applications.  In place of 'conSwNormal', it uses 1.  This function is declared public.

Itiered to use the existing user-defined function with 'conSwNormal' and 1, it didn't work.  I tired declaring it private in the form window where it is used, it didn't work.

Now, I am trying the link posted by EDDYKT.

Regards,

Mike
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12164754
btw, I had 'jsmith@hotmail.com' in a text box not in alable.  It was firring okay.
0
 
LVL 4

Accepted Solution

by:
avi247 earned 1200 total points
ID: 12164867
Mike:
Try this instead above in the label. I tested it and it works.

ShellExecute hWnd, "open", "mailto:jsmith@hotmail.com", vbNullString, vbNullString, 0
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12164986
It worked.  But, I changed its forecolor to neon blue to resemble to hyperlink.  It doesn't appear as hyperlink.

Mike
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12164994
EDDYKT,

Thank you for providing the link.

Mike
0
 
LVL 4

Expert Comment

by:avi247
ID: 12165060
Thanks Mike..you could also have it underlined and stuff if you want to further enhance it, Label>Properties>Font
I assumed you know how to do this and concentrated on the base functionality.
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 12165107
I used mouse move event to chnage its color and underline it.  There is also a golobal boolean variable to be set to True when the link is clicked to make sure the color of the text changes to purple.  On mouse move event of the form itself, I change the color to black (when the cursor is moved away from the lable).  All is fine.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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