giggetto71 Active Member Licensed User Longtime User Jun 1, 2024 #1 Hi, I am facing a strange issue with the XUI progressbar. I am sure I am not using it in the right way so I am asking for some help. In the attached test project I have a panel and pb (progressbar). I have facing the following two issues: 1- upon activity create I would like to extend the pb width to the entire containing panel width by doing B4X: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Layout") pb1.mBase.Width = Panel1.Width pb1.mBase.Left = 0 pb1.Value = 0 End Sub for some reasons the pb does not change size. 2- when I press the pushbutton the value increases by 5 so for example I reach 50%, then I suspend the app and when I resume, when I press the increase button the value increases but the bar does not move.. please help.. thanks!! Attachments TestPB.zip TestPB.zip 9.4 KB · Views: 346
Hi, I am facing a strange issue with the XUI progressbar. I am sure I am not using it in the right way so I am asking for some help. In the attached test project I have a panel and pb (progressbar). I have facing the following two issues: 1- upon activity create I would like to extend the pb width to the entire containing panel width by doing B4X: Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Layout") pb1.mBase.Width = Panel1.Width pb1.mBase.Left = 0 pb1.Value = 0 End Sub for some reasons the pb does not change size. 2- when I press the pushbutton the value increases by 5 so for example I reach 50%, then I suspend the app and when I resume, when I press the increase button the value increases but the bar does not move.. please help.. thanks!!
Alexander Stolte Expert Licensed User Longtime User Jun 1, 2024 #2 giggetto71 said: pb1.mBase.Width = Panel1.Width Click to expand... You need call "Base_Resize". The Base_Resize is private, so you need to call it this way: B4X: pb1.mBase.Width = Panel1.Width pb1.mBase.Left = 0 CallSub3(pb1,"Base_Resize",pb1.mBase.Width,pb1.mBase.Height) 'Update the Width pb1.Value = 100 giggetto71 said: 2- when I press the pushbutton the value increases by 5 so for example I reach 50%, then I suspend the app and when I resume, when I press the increase button the value increases but the bar does not move.. Click to expand... You need to call UpdateGraphics in the Resume event B4X: Sub Activity_Resume pb1.mBase.Width = Panel1.Width pb1.UpdateGraphics End Sub Attachments TestPB.zip TestPB.zip 3.6 KB · Views: 370 Upvote 0
giggetto71 said: pb1.mBase.Width = Panel1.Width Click to expand... You need call "Base_Resize". The Base_Resize is private, so you need to call it this way: B4X: pb1.mBase.Width = Panel1.Width pb1.mBase.Left = 0 CallSub3(pb1,"Base_Resize",pb1.mBase.Width,pb1.mBase.Height) 'Update the Width pb1.Value = 100 giggetto71 said: 2- when I press the pushbutton the value increases by 5 so for example I reach 50%, then I suspend the app and when I resume, when I press the increase button the value increases but the bar does not move.. Click to expand... You need to call UpdateGraphics in the Resume event B4X: Sub Activity_Resume pb1.mBase.Width = Panel1.Width pb1.UpdateGraphics End Sub