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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need code to make an image direct someone at a URL

Status
Not open for further replies.

kfickert

Programmer
Jan 10, 2000
12
US
I need a way for to make my LOGO a click event and the info sent to either to another browser form or call MSIE/NS and load my website.&nbsp;&nbsp;<br><br>Any ideas how to do this?
 
if you place the following code into your project it should do what you require <br><br><font color=blue><b>Option Explicit</b></font><br><br><font color=green>'If you place this piece of code into your form then this is the syntax required. In a module you would replace Private Declare with Public Declare </font><br><br><font color=blue><b>Private Declare Function</b></font> ShellExecute Lib &quot;shell32.dll&quot; Alias &quot;ShellExecuteA&quot; (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) <font color=blue><b>As Long</b></font><br><br><font color=blue><b>Const SW_SHOW = 5</b></font><br><br><br><b><font color=blue>Private Sub</font></b> Picture1_Click()<br><font color=green>'Place this code in the click event of the picture box or image box containing your logo</font><br><br><font color=blue><b>Dim</b></font> res <font color=blue><b>As Variant</b></font><br><br><br><font color=green>'Replace the hotmail.com URl with the URL of your choice. This function call can also open any file with it's associated program eg Word Document</font><br>res = ShellExecute(hwnd, &quot;open&quot;, &quot;<A HREF=" TARGET="_new"> vbNullString, CurDir$, SW_SHOW)<br><br><font color=blue><b>End Sub</font></b><br><br>Hope this is what you were looking for <br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top