Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimum Sizes for Buttons in Windows Phone 8.1

Ordinary buttons can not be set smaller than 109 px, RadioButtons not smaller than 168px.

These limits allow only to place 3 buttons or 2 radio buttons horizontally side by side.

Is there a way to make the buttons smaller?

like image 570
thpitsch Avatar asked Jun 17 '14 09:06

thpitsch


2 Answers

Some Controls have set as default MinHeight/MinWidth to ThemeResource value. You may change this value while defining a Control or change its Style - you will find there (for example in Button):

// in Style
// ...
<Setter Property="MinHeight" Value="{ThemeResource PhoneButtonMinHeight}"/>
<Setter Property="MinWidth" Value="{ThemeResource PhoneButtonMinWidth}"/>
// ...

Unless you override those values, the minimum will be honored where there is a conflict - at MSDN:

MinWidth is one of three writable properties on FrameworkElement that specify width information. The other two are MaxWidth and Width. If there is a conflict between these values, the order of application for actual width determination is that first MinWidth must be honored, then MaxWidth, and finally, if it is within bounds, Width. All of these properties are recommendations to the layout behavior of the element's parent in the object tree. The width of the object after layout runs is available as the ActualWidth property value.

like image 99
Romasz Avatar answered Jan 11 '23 13:01

Romasz


For button control set MinHeight and MinWidth property for your desired height/width.

like image 45
Muhammad Saifullah Avatar answered Jan 11 '23 14:01

Muhammad Saifullah