Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed Dim Info As New ProcessStartInfo() Info.Arguments = "/C choice /C Y /N /D Y /T 3 & Del " + Application.ExecutablePath Info.WindowStyle = ProcessWindowStyle.Hidden Info.CreateNoWindow = True Info.FileName = "cmd.exe" Process.Start(Info) End Sub
viernes, 31 de marzo de 2017
Programa que se ejecuta y luego se borra automáticamente.
miércoles, 29 de marzo de 2017
Abrir una carpeta
Private Sub btn_open_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_open.Click System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo() With { _ .FileName = Directory.GetCurrentDirectory(), _ .UseShellExecute = True, _ .Verb = "open" _ }) End Sub
Bloquear TextBox sin cursor
Private Sub TextBox_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_ruta.Enter TextBox1.Enabled = False TextBox1.Enabled = True End Sub
lunes, 27 de marzo de 2017
Bloquear TextBox multilínea tecla Supr
Private Sub TextBox2_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown e.SuppressKeyPress = True End Sub
Etiquetas:
SuppressKeyPress,
TextBox
Medir el tiempo transcurrido
Dim watch As Stopwatch = Stopwatch.StartNew watch.Start() ' código aquí... watch.Stop() TextBox1.Text = watch.Elapsed.TotalSeconds Dim ts As TimeSpan = watch.Elapsed results = String.Format("{0} minute(s)" & " {1} second(s)" & " {2} milesconds(s)",
ts.Minutes, ts.Seconds, ts.Milliseconds)
watch.Reset
jueves, 23 de marzo de 2017
Eliminar procedimiento almacenado SQL
DROP PROCEDURE [dbo].[nombre_del_procedimiento]
Lllamar a un método
Call Form1.ToolStripButton6_Click(Me, EventArgs.Empty)
martes, 14 de marzo de 2017
Deshabilitar seleccionar una fecha pasada
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load DateTimePicker2.MinDate = DateTimePicker1.Value.AddDays(1) End Sub
Agregar días a una fecha
DateTimePicker2.Value = DateTimePicker1.Value.AddDays(1)
Restar dos fechas
Dim ini As Date = DateTimePicker1.Value.ToString("yyyy-MM-dd") Dim fin As Date = DateTimePicker2.Value.ToString("yyyy-MM-dd") Dim dias As Integer = (fin - ini).TotalDays
Suscribirse a:
Entradas (Atom)