Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/10/2004, 15:01
DADU
 
Fecha de Ingreso: septiembre-2003
Mensajes: 128
Antigüedad: 20 años, 8 meses
Puntos: 0
Muchas gracias Sin Destino, hice lo que me sugeriste y arme una función recursiva. Anda Perfecto.

Por si a alguien le interesa. Deshabilita los textbox y combos de un formulario.

Lllamada: ControlesDeshabilitar(Me.Controls)


Private Function DeshabilitarControles(ByRef objColeccion As System.Web.UI.ControlCollection)
Dim frmTextBox As TextBox
Dim frmDropDownList As DropDownList
Dim intN As Integer

For intN = 1 To objColeccion.Count() - 1
If TypeOf (objColeccion.Item(intN)) Is TextBox Then
frmTextBox = objColeccion.Item(intN)
frmTextBox.ReadOnly = True
frmTextBox.BackColor = Color.FromArgb(15724527)

ElseIf TypeOf (objColeccion.Item(intN)) Is DropDownList Then
frmDropDownList = objColeccion.Item(intN)
frmDropDownList.BackColor = Color.FromArgb(15724527)
frmDropDownList.Enabled = False

Else
DeshabilitarControles(objColeccion.Item(intN).Cont rols)

End If

Next

End Function