Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Http Link on Form 1

Status
Not open for further replies.

Ologhai

Programmer
Apr 11, 2000
42
CA
Hi all :)

I wanna put a http link on a Form.
Some one have idea, the way to do this ?

thanks for your help !!
 
Sure. Put the URL in a label and click it.
[tt]
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
Const SW_SHOWNORMAL = 0

Private Sub Form_Load()
Label1.Caption = "End Sub

Private Sub Label1_MouseUp(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
RetVal = ShellExecute(Me.hwnd, vbNullString, _
Label1.Caption, vbNullString, "c:\", SW_SHOWNORMAL)
End Sub
[/tt]
A semicolon will appear at the end of the "Label1.Caption" line above. Don't include that in your code. It's a Tek-Tips artifact.



VCA.gif

Alt255@Vorpalcom.Intranets.com

"If you can get people to ask the wrong questions, they'll never find the right answers."[tt]
Thomas Pynchon[/tt]

Perhaps the reverse is also true....
 
Good one, Eric! Start will execute the application associated with URLs just like ShellExecute.

It's always good to have an option.
VCA.gif

Alt255@Vorpalcom.Intranets.com

"If you can get people to ask the wrong questions, they'll never find the right answers."[tt]
Thomas Pynchon[/tt]

Perhaps the reverse is also true....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top