Daestrum Expert Licensed User Longtime User Sep 17, 2015 #1 Where in the internal designer can I set the Id for the control ?
Ed Brown Active Member Licensed User Longtime User Sep 17, 2015 #2 Hello @Daestrum I think you might be referring to the 'Name' property in the section 'Main'. This is where I set the ID of the controls that I use in code. If it's the same thing that you're after then don't forget to add Generate Members from the Tools menu. Before you do, make sure that you have selected the code module in the IDE where you want the references added. Upvote 0
Hello @Daestrum I think you might be referring to the 'Name' property in the section 'Main'. This is where I set the ID of the controls that I use in code. If it's the same thing that you're after then don't forget to add Generate Members from the Tools menu. Before you do, make sure that you have selected the code module in the IDE where you want the references added.
Daestrum Expert Licensed User Longtime User Sep 17, 2015 #3 Thanks for the reply, but it's the Id I need not the name. At present ???.Id will always return null for any control. Upvote 0
Thanks for the reply, but it's the Id I need not the name. At present ???.Id will always return null for any control.
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2015 #4 You cannot set the id. It is not used by the internal designer. Set the name and then generate members. If you need to attach another value to the control then set the Tag property. Upvote 0
You cannot set the id. It is not used by the internal designer. Set the name and then generate members. If you need to attach another value to the control then set the Tag property.
Daestrum Expert Licensed User Longtime User Sep 17, 2015 #5 Ok, thanks Erel, will need to find another way to set the Id. All controls have an Id but not all have Tags Upvote 0
Ok, thanks Erel, will need to find another way to set the Id. All controls have an Id but not all have Tags
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2015 #6 All nodes have a Tag property. Upvote 0
Daestrum Expert Licensed User Longtime User Sep 17, 2015 #7 Sorry maybe my previous reply was misleading, I need the id field for things like MenuItem which do not have a tag (according to the api they don't even inherit one). It's not a massive problem as I can run through the scene and add the Id based on the name. Ty for the reply Upvote 0
Sorry maybe my previous reply was misleading, I need the id field for things like MenuItem which do not have a tag (according to the api they don't even inherit one). It's not a massive problem as I can run through the scene and add the Id based on the name. Ty for the reply
Erel B4X founder Staff member Licensed User Longtime User Sep 17, 2015 #8 MenuItems do have a Tag property (which is very important for MenuItems): https://www.b4x.com/android/forum/threads/designer-menu-items.56602/ Upvote 0
MenuItems do have a Tag property (which is very important for MenuItems): https://www.b4x.com/android/forum/threads/designer-menu-items.56602/
Daestrum Expert Licensed User Longtime User Sep 18, 2015 #9 I assume that the 'tag' field is the userdata field is that correct ? The reason I asked about the Id is, without using the Id and using an external css file, how do you style a single control ? Last edited: Sep 18, 2015 Upvote 0
I assume that the 'tag' field is the userdata field is that correct ? The reason I asked about the Id is, without using the Id and using an external css file, how do you style a single control ?
Erel B4X founder Staff member Licensed User Longtime User Sep 18, 2015 #10 Daestrum said: I assume that the 'tag' field is the userdata field is that correct ? Click to expand... Yes. Daestrum said: The reason I asked about the Id is, without using the Id and using an external css file, how do you style a single control ? Click to expand... Simple changes can be done in the designer directly or with the Extra CSS property. If you need to set an id then you can do it in your code. You can also do something like: Code: Copy For Each n As Node In MainForm.RootPane.GetAllViewsRecursive n.Id = n.Tag Next Upvote 0
Daestrum said: I assume that the 'tag' field is the userdata field is that correct ? Click to expand... Yes. Daestrum said: The reason I asked about the Id is, without using the Id and using an external css file, how do you style a single control ? Click to expand... Simple changes can be done in the designer directly or with the Extra CSS property. If you need to set an id then you can do it in your code. You can also do something like: Code: Copy For Each n As Node In MainForm.RootPane.GetAllViewsRecursive n.Id = n.Tag Next
Daestrum Expert Licensed User Longtime User Sep 18, 2015 #11 Thank you, gets me closer to what I am trying to achieve. Upvote 0