Está en la página 1de 5

Controlar que todos los campos estn

llenos-Botones de insertar-guardar

If TextBox1.Text <> "" And TextBox2.Text <> "" And TextBox3.Text <> "" And TextBox4.Text <> "" And TextBox5.Text <> "" And TextBox6.Text <> "" Then
If TextBox1.Enabled = True Then

Dim codigo, nombre, apellido, sexo, seccion, telefono As String

codigo = TextBox1.Text

nombre = TextBox2.Text

apellido = TextBox3.Text

sexo = TextBox4.Text

seccion = TextBox5.Text

telefono = TextBox6.Text

clientes.insertar(codigo, nombre, apellido, sexo, seccion, telefono)

mostrar()

End If

Controlar mximo de caracteres


En el Load

TextBox1.MaxLength = 13

Controlar seleccin de campos en


datagridview-En el evento cellclick del
datagridview

Dim row As DataGridViewRow = DataGridView1.CurrentRow

TextBox1.Text = CStr(row.Cells(0).Value)

TextBox2.Text = CStr(row.Cells(1).Value)

TextBox3.Text = CStr(row.Cells(2).Value)

TextBox4.Text = CStr(row.Cells(3).Value)

TextBox5.Text = CStr(row.Cells(4).Value)

TextBox6.Text = CStr(row.Cells(5).Value)

Controlar tipos de caracteres ingresados


en un textbox-Evento KeyPress

If Char.IsLetter(e.KeyChar) Then

e.Handled = True

ElseIf Char.IsControl(e.KeyChar) Then


e.Handled = False
Else
e.Handled = False
End If

También podría gustarte