filmov
tv
How to Make a Run Dialog in Visual Basic 2008 or 2010
Показать описание
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
'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
Комментарии