ioncila
12-31-2009, 09:21 AM
Hi
May be I dont get it because I'm already thinking of "night reveillon" :)
so I'm asking a little help, if You please
The code below works on a userform (frmAlterar) and it setups enable/disable textboxes of another userform (frmRegisto) by choosing one of the buttons.
This works very fine.
The problem is that the enabled textboxes appear with Backcolor in BLACK and I would want to be the default color of textbox when enable (White).
How do I fix that?
Private Sub HabilitaControles2() 'CORRIGIR DADOS
frmRegisto.txtNOME.Locked = False
frmRegisto.txtTIPO.Locked = False
frmRegisto.txtMATERIAL.Locked = False
frmRegisto.txtMARCA.Locked = False
frmRegisto.txtMODELO.Locked = False
frmRegisto.txtDN1.Locked = False
frmRegisto.txtDN2.Locked = False
frmRegisto.txtPN.Locked = False
frmRegisto.txtDATA.Locked = False
frmRegisto.txtLOC.Locked = False
frmRegisto.txtPRECOUNIT.Locked = False
frmRegisto.txtRESPONSAVEL.Locked = False
frmRegisto.txtOBS.Locked = False
frmRegisto.txtNOME.BackColor = corEnabledTextBox
frmRegisto.txtTIPO.BackColor = corEnabledTextBox
frmRegisto.txtMATERIAL.BackColor = corEnabledTextBox
frmRegisto.txtMARCA.BackColor = corEnabledTextBox
frmRegisto.txtMODELO.BackColor = corEnabledTextBox
frmRegisto.txtDN1.BackColor = corEnabledTextBox
frmRegisto.txtDN2.BackColor = corEnabledTextBox
frmRegisto.txtPN.BackColor = corEnabledTextBox
frmRegisto.txtDATA.BackColor = corEnabledTextBox
frmRegisto.txtLOC.BackColor = corEnabledTextBox
frmRegisto.txtPRECOUNIT.BackColor = corEnabledTextBox
frmRegisto.txtRESPONSAVEL.BackColor = corEnabledTextBox
frmRegisto.txtOBS.BackColor = corEnabledTextBox
End Sub
Private Sub HabilitaControles3() 'ENTRADA DE MATERIAIS
frmRegisto.txtENTRADAS.Locked = False
frmRegisto.txtDATA.Locked = False
frmRegisto.txtPRECOUNIT.Locked = False
frmRegisto.txtORIGEM.Locked = False
frmRegisto.txtRESPONSAVEL.Locked = False
frmRegisto.txtOBS.Locked = False
frmRegisto.txtENTRADAS.BackColor = corEnabledTextBox
frmRegisto.txtDATA.BackColor = corEnabledTextBox
frmRegisto.txtPRECOUNIT.BackColor = corEnabledTextBox
frmRegisto.txtORIGEM.BackColor = corEnabledTextBox
frmRegisto.txtRESPONSAVEL.BackColor = corEnabledTextBox
frmRegisto.txtOBS.BackColor = corEnabledTextBox
End Sub
Private Sub HabilitaControles4() 'SAIDA DE MATERIAIS
frmRegisto.txtSAIDAS.Locked = False
frmRegisto.txtDATA.Locked = False
frmRegisto.txtPRECOUNIT.Locked = False
frmRegisto.txtDESTINO.Locked = False
frmRegisto.txtRESPONSAVEL.Locked = False
frmRegisto.txtOBS.Locked = False
frmRegisto.txtSAIDAS.BackColor = corEnabledTextBox
frmRegisto.txtDATA.BackColor = corEnabledTextBox
frmRegisto.txtPRECOUNIT.BackColor = corEnabledTextBox
frmRegisto.txtDESTINO.BackColor = corEnabledTextBox
frmRegisto.txtRESPONSAVEL.BackColor = corEnabledTextBox
frmRegisto.txtOBS.BackColor = corEnabledTextBox
End Sub
Private Sub CommandButton1_Click()
With frmRegisto
Call HabilitaControles3
End With
frmAlterar.Hide
End Sub
Private Sub CommandButton2_Click()
With frmRegisto
Call HabilitaControles4
End With
frmAlterar.Hide
End Sub
Private Sub CommandButton3_Click()
With frmRegisto
Call HabilitaControles2
End With
frmAlterar.Hide
End Sub
Note: corEnabledTextBox appears in the project code as Constant, like the following:
Const corDisabledTextBox As Long = -2147483633
Const corEnabledTextBox As Long = -2147483643
In spite of I have copied this from another code, that dont affect any of similar subs of the entire project.
The backcolor in BLACK only appears in this three subs (HabilitaControles2, HabilitaControles3 and HabilitaControles4)
Thanks in advance and HAPPY NEW YEAR
Ioncila
May be I dont get it because I'm already thinking of "night reveillon" :)
so I'm asking a little help, if You please
The code below works on a userform (frmAlterar) and it setups enable/disable textboxes of another userform (frmRegisto) by choosing one of the buttons.
This works very fine.
The problem is that the enabled textboxes appear with Backcolor in BLACK and I would want to be the default color of textbox when enable (White).
How do I fix that?
Private Sub HabilitaControles2() 'CORRIGIR DADOS
frmRegisto.txtNOME.Locked = False
frmRegisto.txtTIPO.Locked = False
frmRegisto.txtMATERIAL.Locked = False
frmRegisto.txtMARCA.Locked = False
frmRegisto.txtMODELO.Locked = False
frmRegisto.txtDN1.Locked = False
frmRegisto.txtDN2.Locked = False
frmRegisto.txtPN.Locked = False
frmRegisto.txtDATA.Locked = False
frmRegisto.txtLOC.Locked = False
frmRegisto.txtPRECOUNIT.Locked = False
frmRegisto.txtRESPONSAVEL.Locked = False
frmRegisto.txtOBS.Locked = False
frmRegisto.txtNOME.BackColor = corEnabledTextBox
frmRegisto.txtTIPO.BackColor = corEnabledTextBox
frmRegisto.txtMATERIAL.BackColor = corEnabledTextBox
frmRegisto.txtMARCA.BackColor = corEnabledTextBox
frmRegisto.txtMODELO.BackColor = corEnabledTextBox
frmRegisto.txtDN1.BackColor = corEnabledTextBox
frmRegisto.txtDN2.BackColor = corEnabledTextBox
frmRegisto.txtPN.BackColor = corEnabledTextBox
frmRegisto.txtDATA.BackColor = corEnabledTextBox
frmRegisto.txtLOC.BackColor = corEnabledTextBox
frmRegisto.txtPRECOUNIT.BackColor = corEnabledTextBox
frmRegisto.txtRESPONSAVEL.BackColor = corEnabledTextBox
frmRegisto.txtOBS.BackColor = corEnabledTextBox
End Sub
Private Sub HabilitaControles3() 'ENTRADA DE MATERIAIS
frmRegisto.txtENTRADAS.Locked = False
frmRegisto.txtDATA.Locked = False
frmRegisto.txtPRECOUNIT.Locked = False
frmRegisto.txtORIGEM.Locked = False
frmRegisto.txtRESPONSAVEL.Locked = False
frmRegisto.txtOBS.Locked = False
frmRegisto.txtENTRADAS.BackColor = corEnabledTextBox
frmRegisto.txtDATA.BackColor = corEnabledTextBox
frmRegisto.txtPRECOUNIT.BackColor = corEnabledTextBox
frmRegisto.txtORIGEM.BackColor = corEnabledTextBox
frmRegisto.txtRESPONSAVEL.BackColor = corEnabledTextBox
frmRegisto.txtOBS.BackColor = corEnabledTextBox
End Sub
Private Sub HabilitaControles4() 'SAIDA DE MATERIAIS
frmRegisto.txtSAIDAS.Locked = False
frmRegisto.txtDATA.Locked = False
frmRegisto.txtPRECOUNIT.Locked = False
frmRegisto.txtDESTINO.Locked = False
frmRegisto.txtRESPONSAVEL.Locked = False
frmRegisto.txtOBS.Locked = False
frmRegisto.txtSAIDAS.BackColor = corEnabledTextBox
frmRegisto.txtDATA.BackColor = corEnabledTextBox
frmRegisto.txtPRECOUNIT.BackColor = corEnabledTextBox
frmRegisto.txtDESTINO.BackColor = corEnabledTextBox
frmRegisto.txtRESPONSAVEL.BackColor = corEnabledTextBox
frmRegisto.txtOBS.BackColor = corEnabledTextBox
End Sub
Private Sub CommandButton1_Click()
With frmRegisto
Call HabilitaControles3
End With
frmAlterar.Hide
End Sub
Private Sub CommandButton2_Click()
With frmRegisto
Call HabilitaControles4
End With
frmAlterar.Hide
End Sub
Private Sub CommandButton3_Click()
With frmRegisto
Call HabilitaControles2
End With
frmAlterar.Hide
End Sub
Note: corEnabledTextBox appears in the project code as Constant, like the following:
Const corDisabledTextBox As Long = -2147483633
Const corEnabledTextBox As Long = -2147483643
In spite of I have copied this from another code, that dont affect any of similar subs of the entire project.
The backcolor in BLACK only appears in this three subs (HabilitaControles2, HabilitaControles3 and HabilitaControles4)
Thanks in advance and HAPPY NEW YEAR
Ioncila