P Pantelis Member Licensed User Longtime User Jun 10, 2013 #1 Hi I want to set the properties of my views with variables. So, if for example I have a variable named WidthOfButton then I do the following: Code: Copy Dim WidthOfButtons As Int WidthOfButtons = 40dip Button1.Width = WidthOfButtons Button2.Width = WidthOfButtons But if the value of WidthOfButton is not static but is calculated like this Code: Copy Dim WidthOfButtons As Int WidthOfButtons = SomeVariable / 3 How to assign the result of (SomeVariable / 3) to WidthOfButtons as dip value?
Hi I want to set the properties of my views with variables. So, if for example I have a variable named WidthOfButton then I do the following: Code: Copy Dim WidthOfButtons As Int WidthOfButtons = 40dip Button1.Width = WidthOfButtons Button2.Width = WidthOfButtons But if the value of WidthOfButton is not static but is calculated like this Code: Copy Dim WidthOfButtons As Int WidthOfButtons = SomeVariable / 3 How to assign the result of (SomeVariable / 3) to WidthOfButtons as dip value?
P philgoodgood Member Licensed User Longtime User Jun 10, 2013 #2 hi some answers here : http://www.b4x.com/forum/basic4andr...als/18800-convert-integer-dip.html#post107966 That should help you Last edited: Jun 10, 2013 Upvote 0
hi some answers here : http://www.b4x.com/forum/basic4andr...als/18800-convert-integer-dip.html#post107966 That should help you
klaus Expert Licensed User Longtime User Jun 10, 2013 #3 Use this: Code: Copy WidthOfButtons = DipToCurrent(SomeVariable / 3) Best regards. Upvote 0