gruizelgruis Member Licensed User Longtime User Mar 25, 2015 #1 Hi all, I try to position a button using variabels: B4X: pnl.AddView(p, Cur_TafelGeg.TLeft, Cur_TafelGeg.Ttop, Cur_TafelGeg.TWidth , Cur_TafelGeg.THeight) The value's held by tleft, ttop ...etc are ment to be relative positions. How do I represent the value "50" held in ttop as a 50%y value PLease advice
Hi all, I try to position a button using variabels: B4X: pnl.AddView(p, Cur_TafelGeg.TLeft, Cur_TafelGeg.Ttop, Cur_TafelGeg.TWidth , Cur_TafelGeg.THeight) The value's held by tleft, ttop ...etc are ment to be relative positions. How do I represent the value "50" held in ttop as a 50%y value PLease advice
T Troberg Well-Known Member Licensed User Longtime User Mar 25, 2015 #2 Simply put the value 50%y into Ttop. The real pixel value will be put into Ttop. So, on a device with, say, 1024 height, this: B4X: Cur_TafelGeg.Ttop = 50%y Log(Cur_TafelGeg.Ttop) will result in this: 512 (or, possibly 511, as it's zero-based). Upvote 0
Simply put the value 50%y into Ttop. The real pixel value will be put into Ttop. So, on a device with, say, 1024 height, this: B4X: Cur_TafelGeg.Ttop = 50%y Log(Cur_TafelGeg.Ttop) will result in this: 512 (or, possibly 511, as it's zero-based).
gruizelgruis Member Licensed User Longtime User Mar 25, 2015 #3 The 4 position Values come from outside vba, its send to the app by a VB6 program. All I have is the value 50, that needs to get converted to 50%x I found this works: B4X: Test = Cur_TafelGeg.TLeft * 1%x Upvote 0
The 4 position Values come from outside vba, its send to the app by a VB6 program. All I have is the value 50, that needs to get converted to 50%x I found this works: B4X: Test = Cur_TafelGeg.TLeft * 1%x
T Troberg Well-Known Member Licensed User Longtime User Mar 25, 2015 #4 Ah, well, then I think your method is the easiest. Upvote 0