Custom Control Properties in WinRes


T

Terry

Hopefully someone out there can answer this question. It seems like a basic
problem, but I can't figure out what's wrong.

I have a form with a custom control that I want someone else to localize
with WinRes. When you load the .resx file with WinRes, and the custom
control assembly is in a place that WinRes can find it, it displays all the
controls properly, including the custom control, but not all of the
properties are available for editing in WinRes.

Is there something I'm missing? I have source for the control - do I need
to add something to the control so that WinRes can display the properties of
the control?

Thanks!
Terry
 
Ad

Advertisements

T

Terry

Oh, I wish I would have found this sooner, but shortly after posting I found
my answer.

In the control, any public property that should be localized needs to be
decorated with the "Localizable" attribute set to true. After adding this
attribute to the appropriate properties, they showed up in WinRes.

Considering how difficult localization is to deal with in general, I have to
say Microsoft did an excellent job with their localization support in .NET.
It took me a bit to figure the layout of things, but I think it's
implemented very well.
 
Ad

Advertisements

Joined
Oct 13, 2009
Messages
2
Reaction score
0
I know this post is very, very old but I'm facing a related problem. My user control Text property is showing in the designer when I edit a form containing this usercontrol, but not in WinRes though I need to localize this string! Here's my code:
Code:
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Bindable(true), Localizable(true)]
public override string Text
{
    get
    {
        return this.lblButton.Text;
    }

    set
    {
        this.lblButton.Text = value;
    }
}
Does anybody know why? Thank you very much :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top