Custom Control Properties in WinRes

  • Thread starter Thread starter Terry
  • Start date Start date
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
 
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.
 
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 :-)
 
Back
Top