Forum Moderators: open

Message Too Old, No Replies

Localization of dynamic ToolTip

         

Fotiman

6:17 pm on Feb 9, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've got a Form that contains a couple of System.Windows.Forms.Button objects and a System.Windows.Forms.ToolTip (named mouseOverToolTip). The buttons don't contain any Text, and the background image of the buttons change dynamically at run time depending on the current state.

With the Form set to Localizable=True, I can add a value to the ToolTip on mouseOverToolTip property of each Button, and a value is added to the .resx file for the form. However, I need a way to specify additional values that can be assigned at run time.

My options would appear to be:
1. Add values to the global resource file instead and pull from there
2. Create a Button for each "state", and swap out the buttons instead of changing the background image/tooltip values

Any other options?

It would seem to me that option 1 is more efficient, as I'm only creating a single button object. The down side is that I don't take advantage of some of the designer stuff for managing the tooltip values.

Thoughts?

Ocean10000

2:41 pm on Feb 10, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have used option 1 before its not the worst, just have to document it a bit more is all.

Fotiman

2:46 pm on Feb 10, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That's the approach I've started taking too. Would be nice to have them all stored within their respective resource files instead of a global one, but oh well.
Thanks. :)