Hi,
I am building an app that has database input with many text fields and combo boxes. I validate user entry and color the background of the test boxes with yellow for dirty and red for error.
I wish to set the combo boxes with yellow for dirty, but I cannot find a way of doing it in B4j. It seems you can do it in B4a with the following code:
In B4j the TextColor and Color methods aren't available. This seems strange as I thought the idea of B4XViews was for use across the different platforms.
Does anyone know how I can set the colors in a the standard B4XView combo box or some other way around the problem?
Regards
Rob
I am building an app that has database input with many text fields and combo boxes. I validate user entry and color the background of the test boxes with yellow for dirty and red for error.
I wish to set the combo boxes with yellow for dirty, but I cannot find a way of doing it in B4j. It seems you can do it in B4a with the following code:
B4A Combo Box Set Color:
private Sub SetColorCombo(Combo As B4XComboBox)
Dim M As List
M.Initialize
Dim F As Int
Dim IdSel As Int
IdSel = Combo.SelectedIndex
For f = 0 To Combo.Size-1
M.Add(Combo.GetItem(F))
Next
Dim Col As Int
If IdSel = 0 Then
Col = Colors.White
Else
Col = Colors.Cyan
End If
Combo.cmbBox.TextColor = Col
Combo.mBase.Color = Colors.Black
Combo.cmbBox.Invalidate
Sleep(50)
Combo.SetItems(M)
Combo.SelectedIndex = IdSel
End Sub
In B4j the TextColor and Color methods aren't available. This seems strange as I thought the idea of B4XViews was for use across the different platforms.
Does anyone know how I can set the colors in a the standard B4XView combo box or some other way around the problem?
Regards
Rob