Android Question How to format B4XPlusMinus

Ishmael

Member
Please I need help formating the B4XplusMinus like the attached image
 

Attachments

  • IMG-20250326-WA0001.jpg
    IMG-20250326-WA0001.jpg
    8.7 KB · Views: 21
Solution
That's what I meant, from then on it's easier to use 2 labels and a label in the middle.

B4X:
Private Sub Button1_Click
    
    B4XPlusMinus1.lblMinus.Height = B4XPlusMinus1.lblMinus.Width
    B4XPlusMinus1.lblPlus.Height = B4XPlusMinus1.lblMinus.Width
    
    B4XPlusMinus1.lblMinus.Top = B4XPlusMinus1.mBase.Height/2 - B4XPlusMinus1.lblMinus.Height/2
    B4XPlusMinus1.lblPlus.Top = B4XPlusMinus1.mBase.Height/2 - B4XPlusMinus1.lblPlus.Height/2
    
    B4XPlusMinus1.lblMinus.TextSize = 25
    B4XPlusMinus1.lblPlus.TextSize = 25
    
    B4XPlusMinus1.lblMinus.SetColorAndBorder(xui.Color_Red,0,0,B4XPlusMinus1.lblMinus.Height/2)
    B4XPlusMinus1.lblMinus.TextColor = xui.Color_White...

Ishmael

Member
Thank you Alexander.
I am not getting it round even though I set the rounded corners 100

1742992487443.png
 

Attachments

  • Project.zip
    68.3 KB · Views: 11
Upvote 0

Ishmael

Member
When I use this Code, the RED MINU circle is cut into halve
B4X:
B4XPlusMinus1.lblMinus.Width = B4XPlusMinus1.lblMinus.height '---red button'


When I reduced the size of the circle for the GREEN PLUS button, the button is also hangind at the top

B4X:
B4XPlusMinus1.lblPlus.Width = 30dip 'Green plus button'
B4XPlusMinus1.lblPlus.Height = 30dip

 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
That's what I meant, from then on it's easier to use 2 labels and a label in the middle.

B4X:
Private Sub Button1_Click
    
    B4XPlusMinus1.lblMinus.Height = B4XPlusMinus1.lblMinus.Width
    B4XPlusMinus1.lblPlus.Height = B4XPlusMinus1.lblMinus.Width
    
    B4XPlusMinus1.lblMinus.Top = B4XPlusMinus1.mBase.Height/2 - B4XPlusMinus1.lblMinus.Height/2
    B4XPlusMinus1.lblPlus.Top = B4XPlusMinus1.mBase.Height/2 - B4XPlusMinus1.lblPlus.Height/2
    
    B4XPlusMinus1.lblMinus.TextSize = 25
    B4XPlusMinus1.lblPlus.TextSize = 25
    
    B4XPlusMinus1.lblMinus.SetColorAndBorder(xui.Color_Red,0,0,B4XPlusMinus1.lblMinus.Height/2)
    B4XPlusMinus1.lblMinus.TextColor = xui.Color_White
    
    B4XPlusMinus1.lblPlus.SetColorAndBorder(xui.Color_Green,0,0,B4XPlusMinus1.lblPlus.Height/2)
    B4XPlusMinus1.lblPlus.TextColor = xui.Color_White

End Sub
 
Upvote 0
Solution

Serge Bertet

Active Member
Licensed User
Longtime User
Check this

Android Code Snippet​


 
Upvote 0