Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/07/2011, 15:13
Avatar de rikakashi
rikakashi
 
Fecha de Ingreso: julio-2011
Mensajes: 226
Antigüedad: 12 años, 9 meses
Puntos: 33
Mensaje componentes enabled disabled winforms

Código vb:
Ver original
  1. txt_1_nom.Enabled = True
  2.         txt_2_nom.Enabled = True
  3.         txt_1_ap.Enabled = True
  4.         txt_2_ap.Enabled = True
  5.         txt_rfc.Enabled = True
  6.         txt_calle.Enabled = True
  7.         txt_cp.Enabled = True
  8.         txt_monto.Enabled = True
  9.         txt_limite.Enabled = True
  10.         txt_tipo_tarjeta.Enabled = True
  11.         txt_num_tarj.Enabled = True
  12.         txt_num_locker.Enabled = True
  13.         txt_saldo_vencer.Enabled = True
  14.         txt_saldo_0_30.Enabled = True
  15.         txt_saldo_31_60.Enabled = True
  16.         txt_saldos_61_90.Enabled = True
  17.         txt_saldos_91.Enabled = True
  18.         txt_saldos_total.Enabled = True
  19.         txt_fecha_alta.Enabled = True
  20.         txt_fecha_ult_acc.Enabled = True
  21.         txt_fecha_ult_consumo.Enabled = True
  22.         txt_fecha_ult_pago.Enabled = True
  23.         txt_fecha_ult_comentario.Enabled = True
  24.         txt_fecha_aniversario.Enabled = True
  25.         txt_fecha_cumpleanos.Enabled = True
  26.  
  27.         cmb_titulo.Enabled = True
  28.         cmb_edocivil.Enabled = True
  29.         cmb_pais.Enabled = True
  30.         cmb_estado.Enabled = True
  31.         cmb_ciudad.Enabled = True
  32.         cmb_colonia.Enabled = True
  33.         cmb_ptocardinal.Enabled = True
  34.         cb_status.Enabled = True
  35.         cb_substatus.Enabled = True
  36.         cb_tipo_cuota.Enabled = True
  37.  
  38.         '
  39.        'CHECKBOX
  40.        '
  41.        chk_inha_cred.Enabled = True
  42.         chk_tarj_credito.Enabled = True
  43.         chk_cargo_aut.Enabled = True
  44.         chk_factura.Enabled = True
  45.         chk_datos_adicionales_pv.Enabled = True
  46.         chk_consumo_minimo_salas.Enabled = True
  47.         chk_carga_intereses.Enabled = True
  48.         chk_regalo.Enabled = True
alguien me puede ayudar a resumir esto.. y de igual manes validar si alguno de ellos = Nothing asignarles un valor... sin tanto codigo... ya que para cada control lo tengo asi
Código vb:
Ver original
  1. If txt_fecha_alta.Text = Nothing Then
  2.  
  3.             CL_FECHA_ALTA = 12
  4.         Else
  5.             CL_FECHA_ALTA = txt_fecha_alta.Text
  6.         End If
  7.  
  8.         If txt_fecha_ult_acc.Text = Nothing Then
  9.             CL_FECHA_ULT_ACC = 0
  10.         Else
  11.             CL_FECHA_ULT_ACC = txt_fecha_ult_acc.Text
  12.         End If
  13.  
  14.         If txt_fecha_ult_consumo.Text = Nothing Then
  15.             CL_FECHA_ULT_CON = 0
  16.         Else
  17.             CL_FECHA_ULT_CON = txt_fecha_ult_consumo.Text
  18.         End If
  19.  
  20.         If txt_fecha_ult_pago.Text = Nothing Then
  21.             CL_FECHA_ULT_PAG = 0
  22.         Else
  23.             CL_FECHA_ULT_PAG = txt_fecha_ult_pago.Text
  24.         End If
  25.  
  26.         If txt_fecha_ult_comentario.Text = Nothing Then
  27.             CL_FECHA_ULT_COM = 0
  28.         Else
  29.             CL_FECHA_ULT_COM = txt_fecha_ult_comentario.Text
  30.         End If
  31.  
  32.         If txt_fecha_aniversario.Text = Nothing Then
  33.             CL_FECHA_ANIVERSARIO = 0
  34.         Else.........................................................