Visual Studio Development Bookmark and Share   
 index > Visual Basic Express Edition > buttons for newbs
 

buttons for newbs

Hey i have just started using vb basic 2008 and im tring to make an app to open shorcuts around the computer to like system properties/msconfig/system info ........ ive sucessfully made 2 button so far by accident. My problems is that i dont quite get how i can conect like c:\progam files and device manager.. and things like that to a button could some one run me through how i would go by adding directorys to buttons. ty in advance.
newbiecoder123  Friday, October 16, 2009 6:20 AM
I'll show you the 2 you mentioned

search around, for example, in the Environment namespace to see what's there



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        'to show program files folder
        Dim fbd As New FolderBrowserDialog
        fbd.RootFolder = Environment.SpecialFolder.ProgramFiles
        fbd.ShowDialog()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        'to open device manager
        Process.Start("devmgmt.msc")

    End Sub
  • Proposed As Answer byjwavila Friday, October 16, 2009 7:05 AM
  •  
jwavila  Friday, October 16, 2009 6:33 AM
Omg ty so much ive been tryn to figure that one out i was try to use a totally different command, i was tryn to use a comman like this

Private

 

Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Shell(

 

 

"C:\WINDOWS\system32\control.exe sysdm.cpl,system,2")

 

 End Sub


i have that code to open system properties. If u dont mind me askn how did u figure that that code would open program files im still lost as how that code directed the button to open that, if its not to much to ask could u shed some light on it and explain how that code worked.
newbiecoder123  Friday, October 16, 2009 6:39 AM

it is instantiating a FolderBrowserDialog

then you are setting the RootFolder to start searching in

type this into your code editor (don't paste it) - make sure you have the period at the end. The reason you need to type it instead of pasting is as you type and then enter a period, you will see a list of all the properties, methods, objects you can use

you'll then see the different things for a FolderBrowserDialog. In this case we want to set the RootFolder

then when you type the =, you'll get a list of the Special Directories

        Dim fbd As New FolderBrowserDialog
        fbd.
  • Proposed As Answer byjwavila Friday, October 16, 2009 7:05 AM
  •  
jwavila  Friday, October 16, 2009 6:55 AM
ok i got it now yah its alot easier than it seemed these last 2 days lol since u showed me the process start command ive made 11 buttons on my app and connected 2 of them to folders i really appreciate it man. i get it 100% now, i hope i can return the favor some day. thanks again.
newbiecoder123  Friday, October 16, 2009 7:00 AM
try this one


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("msinfo32.exe")
    End Sub
jwavila  Friday, October 16, 2009 7:08 AM
yah defenetly that was a good one to add to, i just bascically as a first app all im doin is making short cuts to like all the normal things u go into on an average bases like notepad and the calc just to make it easier to access them with out having shortcuts cluttering ur desktop.
newbiecoder123  Friday, October 16, 2009 7:21 AM
Not Bad.
HalleyHan  Friday, October 16, 2009 7:22 AM
ty. i can tell u its when people say making ur first app and goin through all the bs then u get close to finishing it u fall in love with coding cuz right now im havn a blast lol.
newbiecoder123  Friday, October 16, 2009 7:27 AM

You can use google to search for other answers

Custom Search

More Threads

• delete data from excell sheet
• Administrative control in Operting system
• Database update
• Can vb make a folder hidden?
• How do I make a custom Control?
• Playing Radio Without MediaPlayer COM
• How to replace multiple values in string or stringbuilder
• How do you draw X,Y data?
• Printing an access report with vb 05
• Combo Box problem