Jerry Grey Member Posted July 20, 2004 Member Share Posted July 20, 2004 (edited) I don't know how to put a link on buttons and links in VB .net, can anyone help me out?.... ;) Thanks! :D Edited July 21, 2004 by gerry.74 Link to comment Share on other sites More sharing options...
0 Jerry Grey Member Posted July 20, 2004 Author Member Share Posted July 20, 2004 Anyone? :cry: Link to comment Share on other sites More sharing options...
0 GatorV Posted July 20, 2004 Share Posted July 20, 2004 In VB.Net there is a Link URL custom control, in VB, youll need to declare a ShellExec function Nope, you cannot save your program so it doesn't work without .NET... Link to comment Share on other sites More sharing options...
0 Jerry Grey Member Posted July 20, 2004 Author Member Share Posted July 20, 2004 In VB.Net there is a Link URL custom control, in VB, youll need to declare a ShellExec function How do you do that? ShellExec function? I am very new at this. Nope, you cannot save your program so it doesn't work without .NET... But why? :cry: Do I need VB 6? Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted July 20, 2004 Share Posted July 20, 2004 How do you do that? ShellExec function? I am very new at this. I'll give you the quick way so nobody blasts me for being inefficient. ;) :p System.Process.Start( yourLinkLabel.Text ) That works if your Text property is the actual URL you want to navigate to. If you store the URL text in a Link's LinkData property, it's a little more involved. But why? :cry: Do I need VB 6? Well, the executable you create when you compile you .NET app isn't really an executable in the traditional sense. It's a stub of intermediate language that the .NET framework JIT(just-in-time) compiles to machine specific binary executable code. Also, the supporting libraries are contained in the framework. VB 6.0, while compiling to a native binary executable, still requires a runtime, but it is included in the OS since Windows 2000(I believe). Earlier OSes still need to have the MSVBVM60.dll. Link to comment Share on other sites More sharing options...
0 Jerry Grey Member Posted July 21, 2004 Author Member Share Posted July 21, 2004 System.Process.Start( yourLinkLabel.Text ) That works if your Text property is the actual URL you want to navigate to. If you store the URL text in a Link's LinkData property, it's a little more involved. Can I do that with buttons? I don't know the code side yet, I need someone to show me where to go with the GUI ;) Thanks for your help! I need someone to show me where to go with the GUI ;) I told you I am new :p :shifty: Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted July 21, 2004 Share Posted July 21, 2004 So, you just want a button that will launch a URL? I guess I was misunderstanding you. That code will work inside a click event of a button. You'll only need to provide the url in the Start method's arguments. ' inside you click handler System.Process.Start( "www.neowin.net" ) ' for example End Sub Link to comment Share on other sites More sharing options...
0 Redestium Posted July 21, 2004 Share Posted July 21, 2004 More descriptive thread titles will help attract more people to the thread rather than some generic phrase. Link to comment Share on other sites More sharing options...
0 John Veteran Posted July 21, 2004 Veteran Share Posted July 21, 2004 Title edited ^ Report it next time :yes: Or maybe you did, I'm not the moderator for this forum, so I wouldn't see it :unsure: Link to comment Share on other sites More sharing options...
0 Jerry Grey Member Posted July 21, 2004 Author Member Share Posted July 21, 2004 Thanks! :D So, you just want a button that will launch a URL? I guess I was misunderstanding you. That code will work inside a click event of a button. You'll only need to provide the url in the Start method's arguments. I want to like steps but in one program, so you click "next" and it goes to the next form.. Link to comment Share on other sites More sharing options...
0 Elexir Posted July 21, 2004 Share Posted July 21, 2004 System.Process.Start( yourLinkLabel.Text ) I never use that... ... cuz in "System" namespace is no "Process"... The right code: System.Diagnostics.Process.Start(yourLinkLabel.Text) -- or of cource -- System.Diagnostics.Process.Start("https://www.neowin.net") Link to comment Share on other sites More sharing options...
0 azcodemonkey Posted July 21, 2004 Share Posted July 21, 2004 You're right. My bad. :D Not enough storage space in this head. Link to comment Share on other sites More sharing options...
0 Elexir Posted July 21, 2004 Share Posted July 21, 2004 :) it's ok :) I've some issues like this too :) :p (very rare) :D Link to comment Share on other sites More sharing options...
0 Jerry Grey Member Posted July 22, 2004 Author Member Share Posted July 22, 2004 I never use that...... cuz in "System" namespace is no "Process"... The right code: System.Diagnostics.Process.Start(yourLinkLabel.Text) -- or of cource -- System.Diagnostics.Process.Start("https://www.neowin.net") Is that for: So I have my project open, so I added Window form and I have set up the welcome form. Than I added the button, and name it "Next", then I added another Window form, now how do I link them, so when I hit "Next" it goes to the next form. :D Link to comment Share on other sites More sharing options...
0 anthonycara Posted July 22, 2004 Share Posted July 22, 2004 ah i see. if the first form is form1 and the next is form2, try (just doubleclick the button to get the procedure with Handles written out for you) Private Sub Button1_Click() Handles blah Form2.Show Me.Hide End Sub Link to comment Share on other sites More sharing options...
0 Jerry Grey Member Posted July 22, 2004 Author Member Share Posted July 22, 2004 ah i see. if the first form is form1 and the next is form2, try (just doubleclick the button to get the procedure with Handles written out for you) Private Sub Button1_Click() Handles blah ? ? ?Form2.Show ? ? ?Me.Hide End Sub Thanks for your help, you save me a lot of tim:D... :D Link to comment Share on other sites More sharing options...
Question
Jerry Grey Member
I don't know how to put a link on buttons and links in VB .net, can anyone help me out?.... ;)
Thanks! :D
Edited by gerry.74Link to comment
Share on other sites
15 answers to this question
Recommended Posts