Private Sub CreateButton (Text As Object, Code As Int)
If Text = "" Then Return
#if B4J
Dim btn As Button
#else
Dim btn As Label
#End If
btn.Initialize("Button")
Dim xbtn As B4XView = btn
InternalSetTextOrCSBuilderToLabel(xbtn, Text)
xbtn.Tag = Code
xbtn.SetColorAndBorder(ButtonsColor, 0dip, BorderColor, 5dip)
xbtn.SetTextAlignment("CENTER", "CENTER")
xbtn.TextColor = ButtonsTextColor
xbtn.Font = ButtonsFont
Dim numberOfButtons As Int = Base.NumberOfViews 'nothing was added yet except of buttons
Base.AddView(xbtn, Base.Width - 4dip - numberOfButtons * (ButtonWidth + 5dip) - ButtonWidth, _
Base.Height - ButtonsHeight - 4dip, ButtonWidth, ButtonsHeight)
'Comment this line
' If Code = xui.DialogResponse_Cancel Then xbtn.RequestFocus
End Sub