J josete Member Licensed User Longtime User Nov 25, 2014 #1 I have a pane where i add some nodes (buttons,labels,sliders...) at runtime ,and drag them at the position that i want to make a layout.When finished,i want to get all the nodes added and save properties as width,height,top,left,text,etc,etc.I try thi code: Code: Copy For i = 0 To pnlViews.NumberOfNodes -1 Dim n As Node n = pnlViews.GetNode(i) Log(n.Left & " " & n.Top) Next and Code: Copy For each n as Node in pnlViews.GetAllViewsRecursive 'the same problem,don't find hight,width,etc Next but i can't find in node type all properties that i need ,as height or width,etc .There's any way to acces?
I have a pane where i add some nodes (buttons,labels,sliders...) at runtime ,and drag them at the position that i want to make a layout.When finished,i want to get all the nodes added and save properties as width,height,top,left,text,etc,etc.I try thi code: Code: Copy For i = 0 To pnlViews.NumberOfNodes -1 Dim n As Node n = pnlViews.GetNode(i) Log(n.Left & " " & n.Top) Next and Code: Copy For each n as Node in pnlViews.GetAllViewsRecursive 'the same problem,don't find hight,width,etc Next but i can't find in node type all properties that i need ,as height or width,etc .There's any way to acces?
Erel B4X founder Staff member Licensed User Longtime User Nov 25, 2014 #2 Not all nodes types allow you to get the width and height. You can use this code: Code: Copy If n Is Control Then Dim c As Control = n Log(c.Width & "x" & c.Height) End If All nodes except of WebView, Canvas, ImageView and the panes are Controls. Upvote 0
Not all nodes types allow you to get the width and height. You can use this code: Code: Copy If n Is Control Then Dim c As Control = n Log(c.Width & "x" & c.Height) End If All nodes except of WebView, Canvas, ImageView and the panes are Controls.
J josete Member Licensed User Longtime User Nov 25, 2014 #3 thanks erel,it works for some properties ,but not for others like text button ,maxvalue or minvalue of sliders,etc .another way? Upvote 0
thanks erel,it works for some properties ,but not for others like text button ,maxvalue or minvalue of sliders,etc .another way?
J josete Member Licensed User Longtime User Nov 25, 2014 #4 Solved but i must to do the same comparation for every type control: Code: Copy For Each n As Node In pnlViews.GetAllViewsRecursive If n Is Slider Then Dim b As Slider b.Initialize("") b = n Log(b.MaxValue) End If Next Upvote 0
Solved but i must to do the same comparation for every type control: Code: Copy For Each n As Node In pnlViews.GetAllViewsRecursive If n Is Slider Then Dim b As Slider b.Initialize("") b = n Log(b.MaxValue) End If Next