General discussion

Locked

Visual Basic Hyperlink Text Boxes

By jrobins ·
How can I create a hyperlink text box in VB 6.0 like I can do in Access? I haven't been able to find an answer in any of my textbooks on VB. Thanks.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Visual Basic Hyperlink Text Boxes

by classicmanpro In reply to Visual Basic Hyperlink Te ...

Declaration
-----------------------------------------
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
----------------------------------
Call the defaule browser
-----------------------------------
ShellExecute 0&, vbNullString, "www.youraddress.com", vbNullString, _
vbNullString, SW_SHOWNORMAL

Collapse -

Visual Basic Hyperlink Text Boxes

by jrobins In reply to Visual Basic Hyperlink Te ...

I discovered a simple approach of my own to answer this question. On a second form, I added a WebControl for viewing the Internet site that's referenced in the and then added the following code to the textbox double-click event:

Private Sub Text1_DblClick()
Dim URL As String
URL = txtURL.Text
Form1.WindowState = 1
Form2.Show
Form2.WebBrowser1.Navigate URL
End Sub

On Form2 I added a "Return" button to close that form and go back to Form1.

Hope this simple approach helps others who might be trying to do the same thing.

Collapse -

Visual Basic Hyperlink Text Boxes

by jrobins In reply to Visual Basic Hyperlink Te ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums