Designer variables: "Double-entry"?

SteveBee

Member
Licensed User
Longtime User
From my completed uninformed viewpoint <g>, I would expect the B4a code to 'know' about B4a Designer variables..

i.e. If I declare a Label in a layout, why do I also have to declare the Label in the global sub?

I guess I'm thinking VB/ASP.NET... once it's in the dialog/mark-up, I can address it in code.

No doubt the paradigm is different - but is it impossible to "include" automatically these Designer variables?

JAT
Steve
 

warwound

Expert
Licensed User
Longtime User
Hi.

Look under the Designer > Tools menu for Generate Members.

Is that what you're looking for?

Martin.
 
Upvote 0

ssg

Well-Known Member
Licensed User
Longtime User
maybe its because the code section does not know which layout you are loading in design/code time?

if i am not mistaken, after you do activity.loadlayout, only then the objects in the view are accessible. thus we declare the variables in the layout again in code to at least have access to its attributes during code.

cheers!
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
I think the answer is 'no the designer does not automatically create code members for each and every view added to a layout'.

Would you really want each and every view in a layout to have auto generated member code?
Each view that had member code generated but was not accessed via code may even be a waste of resources - depending on the number of views in your layout..?

Martin.
 
Upvote 0

SteveBee

Member
Licensed User
Longtime User
Just saw your reference to this:

"Look under the Designer > Tools menu for Generate Members."

That makes sense....

Tx
 
Upvote 0
Top