barx Well-Known Member Licensed User Longtime User Nov 5, 2012 #1 It would be nice to have a 'MaxHeight' and 'MaxWidth' in designer scripts. e.g. Code: Copy MaxHeight(Height as int, FixTop as Boolean) 'If FixTop is True the button top stays same and bottom moves, Else Bottom fixes and top moves down Code: Copy button1.SetTopBottom(Panel1.Bottom, 100%y) 'button sizes to fill bottom of screen from bottom of Panel above button1.MaxHeight(150dip, False) 'button will grow to a max of 150dip and will always sit on bottom of screen Same sort of thing for MaxWidth
It would be nice to have a 'MaxHeight' and 'MaxWidth' in designer scripts. e.g. Code: Copy MaxHeight(Height as int, FixTop as Boolean) 'If FixTop is True the button top stays same and bottom moves, Else Bottom fixes and top moves down Code: Copy button1.SetTopBottom(Panel1.Bottom, 100%y) 'button sizes to fill bottom of screen from bottom of Panel above button1.MaxHeight(150dip, False) 'button will grow to a max of 150dip and will always sit on bottom of screen Same sort of thing for MaxWidth
Erel B4X founder Staff member Licensed User Longtime User Nov 5, 2012 #2 Code: Copy Button1.SetTopAndBottom(Max(Panel1.Bottom, 100%y - 150dip), 100%y)
barx Well-Known Member Licensed User Longtime User Nov 5, 2012 #3 Very Nice, Your always one step ahead.