Coloring a button changes its size?

CharlesR

Member
Licensed User
Longtime User
This is probably a basic question, but I am looking at adding all of my buttons etc programatically and I have noticed that if a button is given a color it comes up a slightly larger. If you comment out line 38 adding the color in the attached code. the button is the same size as the other 2, but if you leave it in it appears larger. I would be grateful if someone could explain this to me.

Thanks

Charles

'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TabHost1 As TabHost
Dim p1, p2 As Panel
Dim btn1, btn2, btn3 As Button
Dim fsize As Int
End Sub


Sub Activity_Create(FirstTime As Boolean)
TabHost1.Initialize("TabHost1")
fsize = 18
Activity.AddView(TabHost1, 0, 0, 100%x, 100%y)
p1.Initialize("Panel1")
p1.Color = Colors.Red
p2.Initialize("Panel2")
p2.Color = Colors.Blue
TabHost1.AddTab2("Tab 1", p1)
TabHost1.AddTab2("Tab 2", p2)
btn1.Initialize("btn1")
btn1.Text = "Button one"
btn1.TextSize=fsize
p1.AddView(btn1,1%x,70%y,28%x,10%y)
btn2.Initialize("btn2")
btn2.Text = "Button 2"
btn2.TextSize=fsize
p1.AddView(btn2,30%x,70%y,38%x,10%y)
btn3.Initialize("LblCSTdetails")
btn3.Text = "Button 3"
btn3.Color = Colors.Green
btn3.TextSize=fsize
p1.AddView(btn3,70%x,70%y,25%x,10%y)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…