P Pantelis Member Licensed User Longtime User Jun 9, 2013 #1 Hi all I want to change the size of my views located in activity main from a code module. I try with B4X: main.Button1.width = 50dip but it doesn't work. Is it possible to change the Views properties of an Activity module from a Code module?
Hi all I want to change the size of my views located in activity main from a code module. I try with B4X: main.Button1.width = 50dip but it doesn't work. Is it possible to change the Views properties of an Activity module from a Code module?
Erel B4X founder Staff member Licensed User Longtime User Jun 10, 2013 #2 It is not possible to directly access non process-global variables from different modules. You can pass the view to the code module sub and then change its properties: B4X: Sub DoSomethingWithButton(b As Button) b.Width = 50dip End Sub 'From the activity: Module.DoSomethingWithButton(Button1) Upvote 0
It is not possible to directly access non process-global variables from different modules. You can pass the view to the code module sub and then change its properties: B4X: Sub DoSomethingWithButton(b As Button) b.Width = 50dip End Sub 'From the activity: Module.DoSomethingWithButton(Button1)
P Pantelis Member Licensed User Longtime User Jun 10, 2013 #3 Thank you very much Erel. I'll do it that way. Upvote 0