Hi,
As suggested in previous posts to set thema directly, there are some syntax differences between VB and C #..
For example the following:
Application.Theme.Appearances[“toolcontainer”].components[“button”]
in VB NET becomes
Application.Theme.Appearances(“toolcontainer”).components.button..
It works correctly.
Now I want to access to the ‘grid-row’ item of the listview
Application.Theme.Appearances [“listview”]. Components [“grid-row”]
in VB Net the syntax should be
Application.Theme.Appearances (“listview”). Components.grid-row
but this syntax generates an error:
error BC30451: ‘row’ is not declared. It may be inaccessible due to its protection level.
The problem appears to be due to the item name ‘grid-row’ which contains the ‘-‘ character.
What is the right syntax in this case?
Thanks
Hi Angelo,
you can achieve it by using the following syntax
Application.Theme.Appearances("listview")("components")("grid-row")("states")("default")("styles")("backgroundColor") = "red"
Best regards
Frank
Hi Frank,
Now Work fine,
Thank you.
Hi Frank,
I know this bute the issue is in the next level.
Try to explain.
I want change background color of a listview in detail mode.
in mixin thema this:
“listview”: {
“inherit”: “listview”,
“components”: {
“grid-row”: {
“states”: {
“default”: {
“styles”: {
“backgroundColor”: “#ffcc33”
}
}
}
}
}
}
work fine.
But if i set directly the appareance writing in my vb code:
Application.Theme.Appearances(“listview”).components(“grid-row”).states.default.styles.backgroundColor = System.Drawing.Color.Red
The compiler throws “Object variable or With block variable not set.
As suggest in previous post by Alaa (ITG) answered May 17, 2021 – 1:35 p
the correct syntax for vb should be:
Application.Theme.Appearances(“listview”).components.grid-row.states.default.styles.backgroundColor = System.Drawing.Color.Red
but grid-row in not a correct syntax for vb.
In fact for item component the syntax:
Application.Theme.Appearances(“listview”).components.item.states.default.styles.backgroundColor = System.Drawing.Color.Red
work corrctely
Any suggestion?
Hi Angelo,
you can simply use
Application.Theme.Appearances("listview").components("grid-row")
Please note that it´s components, all lowercase.
Best regards
Frank
Please login first to submit.