|
-
Aug 2nd, 2007, 07:27 AM
#1
Thread Starter
New Member
[2008] New Here and New to VB
Hi all
Time for me to go red in the face is suppose.
Anyway i have built a little programe (im proud of it lol)
But for the life of me i cant add a link to a website with in the programme?
I would guess some sort of command needs to go betwwen these lines?
Code:
Private Sub Command1_Click()
End Sub
But what code is it? I have searched for 2 days now and im guessing its so easy no one has written about it 
Any help would be greatly appreciated
Also can adsense be added to software?
Thanks All
Mark
-
Aug 2nd, 2007, 07:34 AM
#2
Re: [2008] New Here and New to VB
Welcome to the forums. 
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
System.Diagnostics.Process.Start(TextBox1.Text)
End Sub
With the desired web site being in the textbox. If you aren't using a textbox, change accordingly.
-
Aug 2nd, 2007, 07:38 AM
#3
Re: [2008] New Here and New to VB
...Time for me to go red in the face is suppose....
....I have searched for 2 days now and im guessing its so easy no one has written about it...
So long as you're here "for help" or "to help" and not to 1) get your homework done 2) have us build an entire project for you or 3) asking for malicious code; don't be worried about the questions you ask.
As many here will tell you, we all started from the begining at one point or another.
Good luck and welcome.
-
Aug 2nd, 2007, 07:41 AM
#4
Thread Starter
New Member
Re: [2008] New Here and New to VB
 Originally Posted by sevenhalo
So long as you're here "for help" or "to help" and not to 1) get your homework done 2) have us build an entire project for you or 3) asking for malicious code; don't be worried about the questions you ask.
As many here will tell you, we all started from the begining at one point or another.
Good luck and welcome.
LOL a little to old to be doing homework now !
Thanks for the welcome im off to try the code
Thanks
Mark
-
Aug 2nd, 2007, 07:48 AM
#5
Re: [2008] New Here and New to VB
I just noticed you listed 2008 as your version.
Are you really using 2008? (Not that it matters, I'm just curious )
-
Aug 2nd, 2007, 07:49 AM
#6
Thread Starter
New Member
Re: [2008] New Here and New to VB
Ok still cant figure it out 
Once i know how to add links i will be ok i think...
Let me explain in greater detail
I want to add a picture to the software similar to a banner (this i have managed) then when its clicked i would like them redirected to a web page www.nethostuk.com
If someone could show me this then i guess i can just change the endpoint to what ever other links i would like to add at a later date...
Thanks and sorry to be a pain but i just cant figure it out
Mark
-
Aug 2nd, 2007, 07:58 AM
#7
Re: [2008] New Here and New to VB
As I said, if you are not using a textbox, then change the control accordingly. Your picture is being housed in something, right? A PictureBox maybe?
They have click events, so just move the code there and change the name to whatever you are calling your picturebox. And change the code to
Code:
System.Diagnostics.Process.Start("http://www.nethostuk.com")
-
Aug 2nd, 2007, 08:00 AM
#8
Re: [2008] New Here and New to VB
Maybe we should take a step back and ask if this is a WebForm or WinForm?
-
Aug 2nd, 2007, 08:01 AM
#9
Re: [2008] New Here and New to VB
 Originally Posted by sevenhalo
Maybe we should take a step back and ask if this is a WebForm or WinForm?
Good point.
So, what are we dealing with here nethostuk?
-
Aug 2nd, 2007, 08:20 AM
#10
Thread Starter
New Member
Re: [2008] New Here and New to VB
Web form i think ?
I have tried the code again and guess what .....Nope i think perhaps i should stick to php and html, but im not givin up yet
Her is what i have changed the code to
Code:
Private Sub Image2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Image2.Click
System.Diagnostics.Process.Start ("http://www.nethostuk.com")
End Sub
Now the pic shows up fine but there is nothing when it is clicked ?
Thanks again
Mark
And ive just checked my version its 6 not 8 so i need to change that
-
Aug 2nd, 2007, 08:50 AM
#11
Lively Member
Re: [2008] New Here and New to VB
If it's a web form, use a hyperlink (might be image hyperlink). You can assign it to have the image and the redirect link when it's clicked.
-
Aug 2nd, 2007, 08:56 AM
#12
Thread Starter
New Member
Re: [2008] New Here and New to VB
 Originally Posted by Sedna
If it's a web form, use a hyperlink (might be image hyperlink). You can assign it to have the image and the redirect link when it's clicked.
lol i have no idea how to do that,when i say im new i mean real new lol
Maybe im not dealing with a form after all ?
I think perhaps i should just give up 
Thanks
mark
-
Aug 3rd, 2007, 02:32 PM
#13
Re: [2008] New Here and New to VB
How did you start this project? From a Winforms application or a WebForms website?
To navigate to a new page/site in asp.net you would use Repsonse.Redirect("http://yoursite.com")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 8th, 2007, 05:30 AM
#14
Thread Starter
New Member
Re: [2008] New Here and New to VB
Ok Im going to have another try.
Let me explain exactly what i have done thus far
I opened microsoft visul studio6 then microsoft visula basic and am creating a .exe project:
I have incleded pictures with this post!
All i want to do is ad a link to an external webpage when clicked on, i dont care where it goes as once i see how to do it i can minipulate it anyway ?
Im just to thick to work it out 
Thanks to all that have been helping
mark
-
Aug 8th, 2007, 05:32 AM
#15
Re: [2008] New Here and New to VB
Ah, ok. You are not using VB.NET 2008 but VB 6. I'll move your thread to the VB 6 forum.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 8th, 2007, 06:12 AM
#16
Re: [2008] New Here and New to VB
Here's a function to open a new browser window to a specified url:
Code:
Public 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
Public Sub OpenURL(pstrURL As String)
Const SW_SHOWNORMAL As Long = 1
ShellExecute 0&, "OPEN", pstrURL, vbNullString, vbNullString, SW_SHOWNORMAL
End Sub
Sample usage:
OpenUrl "http://www.vbforums.com/showthread.php?t=482004"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|