Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

several labels in Designer.cs, the text on the labels should be changed. Several if's?

Hi there;

I got several labels in Designer.cs, and the text on the labels should be changed.

Should I go for several ifs?

I am asking this for the sake of clean coding.

Kind regards.
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazzIIIlove

ASKER

>>do it in the form constructor or the Load event instead of doing it in the Designer.cs file.

Can you give a simple example for this?

Kind regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I mean suppose you have several labels to change their text in the runtime.

>>If you need to intervene on the text at run time, do it in the form constructor or the Load event instead of >>doing it in the Designer.cs file.

Can you provide the LoadEvent example for this, I mean should I have if checks for this, if (this case), then this text on the label else...

Something like that?

Kind regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, but this definitely works but is this way professional enough?

Regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi there;

ok, how can I do this with a dictionary together with a lambda expression? (Let's take your example).

Kind regards.
Can you please tell me what type of If you would have. Otherwise, nothing makes sense and any example I might give would be useless.
ah, I have no idea, just I want to try to use a dictionary idea storing the label index and set the text of the labels with lambda expression.

Possible or am i forcing the idea?

Regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok,
>>during development, resources are xml files that contains strings, images, anything that can change >>between 2 different versions.

ok we are talking about resx files, right?

If so, is it safe to edit them?

Regards
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Is it healthy to write codes manually in resx files as they seem to connect to the form.

Regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial