How to control the button width? Changing the width has no effect? I want to make the width smaller,Is this width the smallest
e.Forms.Button(Text=item[‘text’], Height=25, Width=2, ID=item[‘cmd’], BackgroundColor=item[‘color’],
How to control the button width? Changing the width has no effect? I want to make the width smaller,Is this width the smallest
e.Forms.Button(Text=item[‘text’], Height=25, Width=2, ID=item[‘cmd’], BackgroundColor=item[‘color’],
Hello,
It seems to me that it’s your button’s container that forces the width of those child elements.
for example: Eto.Forms.StackLayout
has VerticalContentAlignment
property.
Otherwise, I don’t know if there is a limit for the width of a button, but they can be smaller.
jmv
It may be too small
After testing, this example can’t get the button
Minimum width
I want to get a smaller width like the image, but I don’t know how to control it
Hi @SONG1,
Looks like you need to add some padding and spacing to your layout. See if the attached example gives you any ideas.
test_eto_button_dialog.py (1.9 KB)
– Dale
It can’t be so small
@SONG1 this should work:
button.Size = drawing.Size(5,5)
and make sure space around it is filled up like:
layout.AddRow(None, button, None)