P pcicom Member Licensed User Longtime User Jul 14, 2017 #1 Hi. How acces a propieries from control by name.. example: List of controls Panel1.height = 100 Panel2.height = 200 Panel3.height = 300 Panel4.height = 400 Sub SizePanel(strNamePanel as String) as int Dim nH as Int nH = strNamePanel.height <--- how acces a properties from name of control. return nH end sub
Hi. How acces a propieries from control by name.. example: List of controls Panel1.height = 100 Panel2.height = 200 Panel3.height = 300 Panel4.height = 400 Sub SizePanel(strNamePanel as String) as int Dim nH as Int nH = strNamePanel.height <--- how acces a properties from name of control. return nH end sub
klaus Expert Licensed User Longtime User Jul 14, 2017 #2 First you should use code tags to display code. Your sub should be, if you have only Panels: B4X: Sub SizePanel(pnl as Panel) as int Dim nH as Int nH = pnl.Height <--- how acces a properties from name of control. return nH End Sub or more general: B4X: Sub SizePanel(v as View) as int Dim nH as Int nH = v.Height <--- how acces a properties from name of control. return nH End Sub Upvote 0
First you should use code tags to display code. Your sub should be, if you have only Panels: B4X: Sub SizePanel(pnl as Panel) as int Dim nH as Int nH = pnl.Height <--- how acces a properties from name of control. return nH End Sub or more general: B4X: Sub SizePanel(v as View) as int Dim nH as Int nH = v.Height <--- how acces a properties from name of control. return nH End Sub