In B4A, after selecting the value of a Combo, I want its color to change. I have it set to the SelectedIndexChange, but the color changes on the next click event.
That is, we'll say that it first draws it and then selects it, so the color is changed with a delayed click. How can I refresh the control so that its color is immediately modified?
This is my code:
That is, we'll say that it first draws it and then selects it, so the color is changed with a delayed click. How can I refresh the control so that its color is immediately modified?
This is my code:
B4X:
Private Sub B4XComboHerramienta1_SelectedIndexChanged (Index As Int)
SetColorCombo(Sender)
End Sub
Private Sub B4XComboMateriales1_SelectedIndexChanged (Index As Int)
SetColorCombo(Sender)
End Sub
Private Sub B4XComboHerramienta2_SelectedIndexChanged (Index As Int)
SetColorCombo(Sender)
End Sub
Private Sub B4XComboMateriales2_SelectedIndexChanged (Index As Int)
SetColorCombo(Sender)
End Sub
private Sub SetColorCombo(Combo As B4XComboBox)
Dim Col As Int
If Combo.SelectedIndex = 0 Then
Col = Colors.White
Else
Col = Colors.Cyan
End If
'different attempts
'no'
'Combo.mBase.SetColorAndBorder(Col, 0dip, Col,10dip)
'this is my best code:
Combo.cmbBox.TextColor = Col
'i need, chage only de textcolor'
'Combo.mBase.Color = Colors.Black
End Sub