arenaluigi Well-Known Member Licensed User Longtime User Jun 12, 2012 #1 Hello, sorry my bad english. When to call a property of control generated to the designer, I get an error null pointer exception. Example: B4X: dim pnl as panel (autogenerate by designer) in the basic code pnl.top=50 (this generate error) whi ? Thanks
Hello, sorry my bad english. When to call a property of control generated to the designer, I get an error null pointer exception. Example: B4X: dim pnl as panel (autogenerate by designer) in the basic code pnl.top=50 (this generate error) whi ? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jun 12, 2012 #2 Have you loaded the layout file? B4X: Activity.LoadLayout(...) Upvote 0
arenaluigi Well-Known Member Licensed User Longtime User Jun 12, 2012 #3 Problem references in designer Yes. This my code: B4X: Dim PnlHeader As Panel (generate by designer) Activity.LoadLayout("blacklist") PnlHeader.Initialize("") PnlHeader.top=30 (Error null) scrlDati.Initialize(0) PnlBody=scrlDati.Panel Activity.AddView(scrlDati,0,20, 100%x, 100%y) Thanks Upvote 0
Problem references in designer Yes. This my code: B4X: Dim PnlHeader As Panel (generate by designer) Activity.LoadLayout("blacklist") PnlHeader.Initialize("") PnlHeader.top=30 (Error null) scrlDati.Initialize(0) PnlBody=scrlDati.Panel Activity.AddView(scrlDati,0,20, 100%x, 100%y) Thanks
klaus Expert Licensed User Longtime User Jun 12, 2012 #4 You must remove this line: B4X: PnlHeader.Initialize("") Views defined in the designe MUST NOT be initialized in the code. Best regards. Upvote 0
You must remove this line: B4X: PnlHeader.Initialize("") Views defined in the designe MUST NOT be initialized in the code. Best regards.
arenaluigi Well-Known Member Licensed User Longtime User Jun 12, 2012 #5 Thanks !!!:sign0060: Upvote 0