How to Make a Run Dialog in Visual Basic 2008 or 2010

preview_player
Показать описание
Hey guys...in this tutorial i will show you how to make a run dialog in Visual Basic 2008 or 2010. This is almost the exact same as the windows run dialog, it just really has a different format, it also will remember the last command you typed into it so its pretty cool. Ok so here be the codes:

'Button1-Run
Try
Shell(TextBox1.Text)
My.Settings.Run = TextBox1.Text
My.Settings.Save()

My.Settings.Reload()

Catch ex As Exception
MsgBox("Cannot find " & TextBox1.Text & ". Please make sure that the file exists.", MsgBoxStyle.Critical, "Error")

End Try
'Button2-Cancel
End
'Form1_Load:
TextBox1.Text = My.Settings.Run
'TextBox1_KeyDown:
If e.KeyCode = Keys.Enter Then
Try
Shell(TextBox1.Text)
My.Settings.Run = TextBox1.Text
My.Settings.Save()

My.Settings.Reload()

Catch ex As Exception
MsgBox("Cannot find " & TextBox1.Text & ". Please make sure that the file exists.", MsgBoxStyle.Critical, "Error")

End Try
End If

I recommend u actually watch the vid, especially if you are new to VB. and also you will need to go to Project-RunDialog Properties then gp to the settings tab and add in a new setting called Run.
If you are confused, watch the vid agin, or Post a comment or PM me. Thanks for watching, Remember...to rate comment and subscribe
Рекомендации по теме
Комментарии
Автор

to open file directories in the run box type "explorer.exe ::" and add the CLSID (including the brackets but not the name or the spaces) for the folder. some common CLSIDs are shown below:

Control Panel
Computer
Documents
Recycle Bin

ex: "explorer.exe

works on windows 7 (maybe lower)

rjzhottest
Автор

sorry for the bad text config just cant use the small message box :)

VisualBasicRules
Автор

Hey man nice video, you seem pretty confident in VB.

I am currently trying to make a telnet client, which the basic goal of is to allow helpdesk staff perform basic functions on a cisco networing device.

I got the telnet client working, thanks heavily to code sourced on the internet. Problem is, the number of devices to be managed numbers in the hundreds, and all of them must be imported from excel dynamically into a drop down box.

Any ideas on a way to do this?

LtShifty
Автор

Can you please make the video to run a tad slower?

abeda
Автор

How did you get the process.start to work for opening directory's? Like ( My Music ). I have the program working with Process.start. Burt it will still not open files like windows Run does! Help please...

nightsky
Автор

I mean you can remove registration folder from regedit by going run.Do you know how to make all the softwares free by using regedit.

ShinyArjunSingh
Автор

Instead of MsgBox("Cannot Find " & TextBox1.Text & ". Please make sure that the file exists", MsgBoxStyle.Critical, "error"), just put Dim speech
Speech = createobject("sapi.spvoice")
speech.speak(textbox1.text)

VisualBasicRules
Автор

Nice vedio dud, Do you know how to make software free with regedit as we make vb 2008 free with regedit.

ShinyArjunSingh
Автор

@jongray01 Oops i didn't realize it would turn out like that. ohh well, it's all there. lmfao

JonathanGray