S stanks Active Member Licensed User Longtime User Nov 10, 2023 #1 Hi When button is added to panel, tooltip is at wrong position. I am trying this with Erels example. I added one panel and one button in it and this code: Code: Private Sub Button5_LongClick Dim btn As B4XView = Sender ToolTip.Show(btn.Left + btn.Width, btn.Top + btn.Height / 2, "RIGHT", $"wefwefwef lwkef j jwlkefj lwke fjwe wefjlwkef jlwkefw ef wejklfj welkf"$) End Sub So when user long click on button tooltip must be visible on right position of button but it is visible at wrong position on screen. How to solve this? Thanks
Hi When button is added to panel, tooltip is at wrong position. I am trying this with Erels example. I added one panel and one button in it and this code: Code: Private Sub Button5_LongClick Dim btn As B4XView = Sender ToolTip.Show(btn.Left + btn.Width, btn.Top + btn.Height / 2, "RIGHT", $"wefwefwef lwkef j jwlkefj lwke fjwe wefjlwkef jlwkefw ef wejklfj welkf"$) End Sub So when user long click on button tooltip must be visible on right position of button but it is visible at wrong position on screen. How to solve this? Thanks
Erel B4X founder Staff member Licensed User Longtime User Nov 12, 2023 #2 If all the layout is inside a panel then initialize Tool with this panel instead of Root. Otherwise you need to calculate the correct offset yourself: Code: ToolTip.Show(btn.Parent.Left + btn.Left + btn.Width / 2, btn.Parent.Top + btn.Top + btn.Height, ... Upvote 0
If all the layout is inside a panel then initialize Tool with this panel instead of Root. Otherwise you need to calculate the correct offset yourself: Code: ToolTip.Show(btn.Parent.Left + btn.Left + btn.Width / 2, btn.Parent.Top + btn.Top + btn.Height, ...