Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/02/2010, 10:41
fjchavez
 
Fecha de Ingreso: julio-2006
Mensajes: 114
Antigüedad: 18 años, 9 meses
Puntos: 0
Respuesta: Mejoras a formulario

Gracias por la respuesta, este es el código.

Código vb:
Ver original
  1. Private Sub CB3_Change()
  2. Select Case CB3.Text
  3. Case "No"
  4. CB4.Enabled = False
  5. Case "Sí"
  6. CB4.Enabled = True
  7. End Select
  8. End Sub
  9.  
  10. Private Sub CB4_Change()
  11. Select Case CB4.Text
  12. Case "Ninguno"
  13. TextBox03.Enabled = False
  14. TextBox03.BackColor = UserForm1.BackColor
  15. TextBox06.Enabled = False
  16. TextBox06.BackColor = UserForm1.BackColor
  17. TextBox04.Enabled = False
  18. TextBox04.BackColor = UserForm1.BackColor
  19. TextBox07.Enabled = False
  20. TextBox07.BackColor = UserForm1.BackColor
  21. TextBox05.Enabled = False
  22. TextBox05.BackColor = UserForm1.BackColor
  23. TextBox08.Enabled = False
  24. TextBox08.BackColor = UserForm1.BackColor
  25. Case "Uno"
  26. TextBox03.Enabled = True
  27. TextBox03.BackColor = vbWhite
  28. TextBox03.SetFocus
  29. TextBox06.Enabled = True
  30. TextBox06.BackColor = vbWhite
  31. TextBox04.Enabled = False
  32. TextBox04.BackColor = UserForm1.BackColor
  33. TextBox07.Enabled = False
  34. TextBox07.BackColor = UserForm1.BackColor
  35. TextBox05.Enabled = False
  36. TextBox05.BackColor = UserForm1.BackColor
  37. TextBox08.Enabled = False
  38. TextBox08.BackColor = UserForm1.BackColor
  39. Case "Dos"
  40. TextBox03.Enabled = True
  41. TextBox03.BackColor = vbWhite
  42. TextBox03.SetFocus
  43. TextBox06.Enabled = True
  44. TextBox06.BackColor = vbWhite
  45. TextBox04.Enabled = True
  46. TextBox04.BackColor = vbWhite
  47. TextBox07.Enabled = True
  48. TextBox07.BackColor = vbWhite
  49. TextBox05.Enabled = False
  50. TextBox05.BackColor = UserForm1.BackColor
  51. TextBox08.Enabled = False
  52. TextBox08.BackColor = UserForm1.BackColor
  53. Case "Tres"
  54. TextBox03.Enabled = True
  55. TextBox03.BackColor = vbWhite
  56. TextBox03.SetFocus
  57. TextBox06.Enabled = True
  58. TextBox06.BackColor = vbWhite
  59. TextBox04.Enabled = True
  60. TextBox04.BackColor = vbWhite
  61. TextBox07.Enabled = True
  62. TextBox07.BackColor = vbWhite
  63. TextBox05.Enabled = True
  64. TextBox05.BackColor = vbWhite
  65. TextBox08.Enabled = True
  66. TextBox08.BackColor = vbWhite
  67. End Select
  68. End Sub
  69.  
  70. Private Sub UserForm_Initialize()
  71. CB3.List = Array("No", "Sí")
  72. CB3.ListIndex = 0
  73. CB4.List = Array("Ninguno", "Uno", "Dos", "Tres")
  74. CB4.ListIndex = 0
  75. End Sub