J Jerryk Active Member Licensed User Longtime User Feb 9, 2025 #1 In the example I have a Panel and two Labels, the second one is rotated by -90 degrees. I want to programmatically fill the Panel with these labels. The first Label is filled correctly, the second one is filled incorrectly. B4X: Private Sub Button4_Click Label1.Top = 0 Label1.Left = 0 Label1.Width = Panel2.Width Label1.Height = Panel2.Height Label2.As(B4XView).Rotation = -90 Label2.Top = 0 Label2.Left = 0 Label2.Width = Panel2.Height Label2.Height = Panel2.Width End Sub picture after Label2.Top = 0 Label2.Left = 0 Any solutios?
In the example I have a Panel and two Labels, the second one is rotated by -90 degrees. I want to programmatically fill the Panel with these labels. The first Label is filled correctly, the second one is filled incorrectly. B4X: Private Sub Button4_Click Label1.Top = 0 Label1.Left = 0 Label1.Width = Panel2.Width Label1.Height = Panel2.Height Label2.As(B4XView).Rotation = -90 Label2.Top = 0 Label2.Left = 0 Label2.Width = Panel2.Height Label2.Height = Panel2.Width End Sub picture after Label2.Top = 0 Label2.Left = 0 Any solutios?
Solution LucaMs Feb 10, 2025 B4X: Label2.Visible = False Label2.Width = Panel2.Height Label2.Height = Panel2.Width Label2.Left = (Panel2.Width - Label2.Width) / 2 Label2.Top = (Panel2.Height - Label2.Height) / 2 Label2.Rotation = -90 Label2.Visible = True
B4X: Label2.Visible = False Label2.Width = Panel2.Height Label2.Height = Panel2.Width Label2.Left = (Panel2.Width - Label2.Width) / 2 Label2.Top = (Panel2.Height - Label2.Height) / 2 Label2.Rotation = -90 Label2.Visible = True
LucaMs Expert Licensed User Longtime User Feb 9, 2025 #2 Try adding Sleep(0) (or Sleep(30) after Jerryk said: Label2.As(B4XView).Rotation = -90 Click to expand... Upvote 0
Try adding Sleep(0) (or Sleep(30) after Jerryk said: Label2.As(B4XView).Rotation = -90 Click to expand...
LucaMs Expert Licensed User Longtime User Feb 9, 2025 #3 LucaMs said: Try adding Sleep(0) (or Sleep(30) after Click to expand... Amazingly that way works in B4J but not in B4A. I'll try. Upvote 0
LucaMs said: Try adding Sleep(0) (or Sleep(30) after Click to expand... Amazingly that way works in B4J but not in B4A. I'll try.
LucaMs Expert Licensed User Longtime User Feb 10, 2025 #4 B4X: Label2.Visible = False Label2.Width = Panel2.Height Label2.Height = Panel2.Width Label2.Left = (Panel2.Width - Label2.Width) / 2 Label2.Top = (Panel2.Height - Label2.Height) / 2 Label2.Rotation = -90 Label2.Visible = True Upvote 0 Solution
B4X: Label2.Visible = False Label2.Width = Panel2.Height Label2.Height = Panel2.Width Label2.Left = (Panel2.Width - Label2.Width) / 2 Label2.Top = (Panel2.Height - Label2.Height) / 2 Label2.Rotation = -90 Label2.Visible = True