473,396 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

need help with localizable, inheritance, etc.

This problem has stumped me for almost two years now. In a nutshell...

1) I create a textbox class, and set the font to Tahoma 8
2) I drop the textbox class on a form, and set other properties (name, etc.)
3) I build my form, and then users say they don't want Tahoma 8, they want
Tahoma 9
4) I go back to the textbox class and change it to Tahoma 9
5) I return to the form and rebuild it, and it still shows Tahoma 8 when I
run it.

Only way to get it to show Tahoma 9 is to right-click on font in the prop
sheet, and click RESET...very inefficient if there are many forms.

I realized the reason for the behavior is that in step 2, the Winform
designer actually writes code out based what the font evaluates to at that
time. So that basically 'breaks' inheritance. Coming from VFP world, where
inheritance seems to be 'clean', this was a real shock.

I recently came across localizable, ambientvalue, and shouldserialize, and
thought those would help...but they don't seem to have any effect (at least
not the way I'm using them).

So basically, here's a stripped down version of my textbox class...

public class ccTextBox : System.Windows.Forms.TextBox
{
private Font _MyFont;
public Font MyFont
{
get { return _MyFont;}
set { _MyFont = value;}
}

public ccTextBox()
{
MyFont = new Font("Tahoma",8);

this.Font = MyFont;
}
}
How would/where would I set localizable (and maybe ambientvalue) so that my
winform will always read from the class, and never generate code in the
designer? I tried the following right above where I created the font
property, but to no avail...

[ Localizable(true), AmbientValue(null) ]

I'll be SO grateful to whomever can help me on this one!

Thanks,
Kevin
Nov 16 '05 #1
0 1942

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kevin | last post by:
This problem has stumped me for almost two years now. In a nutshell... 1) I create a textbox class, and set the font to Tahoma 8 2) I drop the textbox class on a form, and set other properties...
0
by: Kristof | last post by:
I have created a framework with all our controls and forms we re-use in different projects. When we build the framework application we have a dll that we can reference in our project. When I...
3
by: Robin Tucker | last post by:
I did a little experiment during localization of my software (or at least preparations for localization) - without adding any language resources, I just went through changing the Localizable...
3
by: Michael Brown | last post by:
Hi there, After applying the "Localizable" attribute to my form using the (form) properties window in VS, I was expecting to see "" preceding my form's class in code (added automatically by the...
7
by: Ryan | last post by:
I'm creating a user control that has a handful of controls on it (19 in total). One of the controls on the UC is a textbox for a user's password, so I've set the PasswordChar property to "*". I...
1
by: choupi | last post by:
Hi, When Localizable = True for my Form, the ImageList of my TreeView control doesn't show any image anymore (blank instead). The strange thing is that the problem doesn't appear in another...
0
by: Johnny Jörgensen | last post by:
I had a project where I happened to set Localizable = true for a form just to test it. But I decided agains making a multi language application, and set Localizable = false again. Now, whenever...
0
by: =?Utf-8?B?V2F5bmVN?= | last post by:
I just had a thought and wondered if I am missing something or it is a good suggestion. Looking at some code, I was sorting through strings that should be put into a resource file for...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have a Solution with 50 project and over 100 forms - I need to ensure That on each form the Localizable Property is set to TRUE Where is that property store and is there a way to write a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.