grant1842 Active Member Licensed User Longtime User Apr 19, 2012 #1 I am new B4A development. I have use Borlands Delphi for years to do windows apps. I really like this software I am having a few problems with some basic stuff. I made a new layout (FORM) in the designer (ContactUs.bal). I have a menu item on the main form. Code: Copy Sub ContactUs_Click Activity.LoadLayout("ContactUs.bal") lbl_contact.Visible= True lbl_contact.BringToFront Activity.AddView(lbl_contact,3,50,76,76) End Sub this code gives an error about removing view of parent. I am looking for help on displaying and closing these .bal (forms) . Thanks for your help.
I am new B4A development. I have use Borlands Delphi for years to do windows apps. I really like this software I am having a few problems with some basic stuff. I made a new layout (FORM) in the designer (ContactUs.bal). I have a menu item on the main form. Code: Copy Sub ContactUs_Click Activity.LoadLayout("ContactUs.bal") lbl_contact.Visible= True lbl_contact.BringToFront Activity.AddView(lbl_contact,3,50,76,76) End Sub this code gives an error about removing view of parent. I am looking for help on displaying and closing these .bal (forms) . Thanks for your help.
NJDude Expert Licensed User Longtime User Apr 19, 2012 #2 If you create layouts using the designer you DO NOT have to do this: Code: Copy Activity.AddView(lbl_contact,3,50,76,76) The error you mentioned happens because you are trying to add a view already added to the activity, you don't have to do it if you create layouts using the designer as I mentioned above. Regarding "closing" layouts, what exactly you want to do? layouts cannot be "closed" in B4A. Upvote 0
If you create layouts using the designer you DO NOT have to do this: Code: Copy Activity.AddView(lbl_contact,3,50,76,76) The error you mentioned happens because you are trying to add a view already added to the activity, you don't have to do it if you create layouts using the designer as I mentioned above. Regarding "closing" layouts, what exactly you want to do? layouts cannot be "closed" in B4A.
grant1842 Active Member Licensed User Longtime User Apr 19, 2012 #3 Thanks for your help. Can you give me a proper example on how to show the ContactUs.bal . It just has a label1 on it. Thanks. Upvote 0
Thanks for your help. Can you give me a proper example on how to show the ContactUs.bal . It just has a label1 on it. Thanks.
NJDude Expert Licensed User Longtime User Apr 19, 2012 #4 Take a look at the documentation HERE Upvote 0
margret Well-Known Member Licensed User Longtime User Apr 19, 2012 #6 If you add a panel in the layout of the designer and make the panel the parent to all controls you can then use: panelname.visible = False Upvote 0
If you add a panel in the layout of the designer and make the panel the parent to all controls you can then use: panelname.visible = False
klaus Expert Licensed User Longtime User Apr 19, 2012 #7 Have a look at this thread : Different examples with 2 layouts. The standard way Android works is using different Activities, the TwoLayoutActivities example. Best regards. Upvote 0
Have a look at this thread : Different examples with 2 layouts. The standard way Android works is using different Activities, the TwoLayoutActivities example. Best regards.