19/02/2013, 17:17
|
|
Respuesta: eventos y botones Te paso este codigo que hice para responder tu duda, y mostrarte lo que creo que te refieres.
Espero te sirva de ayuda, Saludos Histoclin.
Public Class Form2
Private Sub Form2_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If Not Validacion() Then
e.Cancel = True
Else
Me.Dispose()
End If
End Sub
Private Function Validacion() As Boolean
If Me.ComboBox1.Text = "" Then
MsgBox("El combo debe tener texto")
Return False
End If
If Me.TextBox1.Text = "" Then
MsgBox("El textbox debe tener texto")
Return False
End If
Return True
End Function
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.ComboBox1.Items.Add("Histolcin")
Me.ComboBox1.Items.Add("Histolcin")
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class |