Coolguy6318 Posted September 22, 2010 Author Share Posted September 22, 2010 How do I make a code that when they click my lblNews it goes to my site? Link to comment Share on other sites More sharing options...
Murdoc Posted September 22, 2010 Share Posted September 22, 2010 @Coolguy6318:> How do I make a code that when they click my lblNews it goes to my site?This might help:[http://www.youtube.com/watch?v=e4W1fI8zmKY](http://www.youtube.com/watch?v=e4W1fI8zmKY) Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 22, 2010 Author Share Posted September 22, 2010 i typed Private Sub lblNews_Click()webbrowser1.navigate "http://godofdistruction.webs.com"End Subwhen i run it(f5) and click the lable i get run time error 424 object required Link to comment Share on other sites More sharing options...
Robin Posted September 22, 2010 Share Posted September 22, 2010 The wonders of Google.[http://www.devx.com/vb2themax/Tip/18339](http://www.devx.com/vb2themax/Tip/18339) Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 22, 2010 Author Share Posted September 22, 2010 O its working now i just had to make a new form with a web browser in it xD Link to comment Share on other sites More sharing options...
Robin Posted September 22, 2010 Share Posted September 22, 2010 @Coolguy6318:> O its working now I just had to make a new form with a web browser in it xDGod no, don't do that. Follow my link and have it open up the default webbrowser.The IE control is messy and disgusting. Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 22, 2010 Author Share Posted September 22, 2010 When i put```Private Sub lblNews_Click()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' Open the default browser on a given URL' Returns True if successful, False otherwisePublic Function OpenBrowser(ByVal URL As String) As Boolean Dim res As Long ' it is mandatory that the URL is prefixed with http:// or https:// If InStr(1, URL, "http", vbTextCompare) <> 1 Then URL = "http://" & URL End If res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _ vbNormalFocus) OpenBrowser = (res > 32)End Function```i get compile error only comments may appear after End sub, End Function or end property Link to comment Share on other sites More sharing options...
Robin Posted September 22, 2010 Share Posted September 22, 2010 You're an idiot. Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 22, 2010 Author Share Posted September 22, 2010 Im new at this :icon_crap: Link to comment Share on other sites More sharing options...
Robin Posted September 22, 2010 Share Posted September 22, 2010 @Coolguy6318:> Im new at this :icon_crap:Then go read up on the basics of VB6 before asking people to do everything for you. Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 22, 2010 Author Share Posted September 22, 2010 Ok its working now i just had 2 change it to this```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' Open the default browser on a given URL' Returns True if successful, False otherwisePublic Function OpenBrowser(ByVal URL As String) As Boolean Dim res As Long ' it is mandatory that the URL is prefixed with http:// or https:// If InStr(1, URL, "http", vbTextCompare) <> 1 Then URL = "http://" & URL End If res = ShellExecute(0&, "open", URL, vbNullString, vbNullString, _ vbNormalFocus) OpenBrowser = (res > 32)End FunctionPrivate Sub lblNews_Click()Call OpenBrowser("http://godofdistruction.webs.com/apps/blog")End Sub```Thanks for help :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now