Hi,
In previous post you suggest me how to set directly theme properties with C# code.
Application.Theme.Appearances[“toolcontainer”].components[“button”].components[“icon”].states.@default.properties.width = 5;
Application.Theme.Appearances[“toolcontainer”].components[“button”].components[“icon”].states.@default.properties.height = 5;
In c# application that’s work nice.
Now I want to use it in VB application and I have syntax error.
This part of the code:
Application.Theme.Appearances(“button”).components(“icon”)
is good and in debug I see correctly de component istance.
But when add the states:
Application.Theme.Appearances(“button”).components(“icon”).states
the code in debug give me error: the istance is nothing.
Can you explain me the correct syntax?
Thanks
Hello Angelo,
It appears that there’s a small discrepancy between C# and VB.NET.
The correct syntax would be Application.Theme.Appearances(“button”).components.icon.states .
The compiler throws “Object variable or With block variable not set” because when you try to access the components as an array, it gets the entire object.
let’s say you want to change the icon’s width, for that you’ll have to use
Application.Theme.Appearances(“button”).components.icon.states.default.properties.width = 30
Hope this helps.
Best regards,
Alaa
Please login first to submit.