473,399 Members | 2,858 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,399 software developers and data experts.

Set Property for Controls by Name as a String

To make it easier for translators to convert my program to their local
language, I'm using XML files as translation dictionaries since its
much easier for deployment and production purposes.

This is a sample XML File:

<translation>
<language key="en_US" rtl="false">
<form1>
<button1>Submit Form</button1>
<label1>Type your name here</label1>
</form1>
<form2>
<label1>About this Program</label1>
<button3>E&xit</button3>
</form2>
</language>
</translation>

I'm open to any all suggestions regarding the data structure, but this
seems to do what I need.
Now with an XML parser, I have all the data in strings.

in a for each loop that iterates through the contents of the
<languagesub-tree's <form*sub-trees, how can I access the control
as a winform control?

pseudocode

for each form in language as winform
for each control in winform as generic-control
set generic-control.caption = string
.........

Any suggestions?

May 15 '07 #1
1 1484
I should probably add: I'm cycling through all forms then all controls
on that form, and comparing the name of the current control to a node
of the tree, and if it's a match, I'm assigning it the value. But this
is a huge waste of resources.

May 15 '07 #2

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

Similar topics

0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
15
by: Mark Goldin | last post by:
I have main aspx page with a number of user controls. How can I create a global property that will be visible in every user control? Thanks
5
by: RSH | last post by:
I havent been able to set a property from another class with out getting some sort of error. Can someone please tell me what I'm doing wrong here? Public Class Form1
13
by: Bevan Arps | last post by:
I have a simple question, but one to which I haven't (after a whole bunch of Googling) been able to find an answer: Are there any guarantees to the order of PropertyInfo objects returned by a...
4
by: MLH | last post by:
Seeking code to ID & print all controls on all forms having a ValidationRule property set - but no ValidationText property setting. Perhaps some modification of the following procedure would do...
0
by: Jeremy Chapman | last post by:
I have included below virtually all the code to a control I'm trying to build. My issue is that an array list property in my control does not get persisted properly to the aspx page code in design...
0
by: Nenefta | last post by:
Hi all, I would like to create something that should be fairly simple I guess, but I just might be taking a wrong road here or just don't know where to look for an answer. Please enlighten me! ...
7
by: Nemisis | last post by:
Hi everyone, Can anyone tell me if it is possible to pass in a property of an object into a sub, and within that sub, find out the name of the item that was passed along with the property name??...
11
by: Andrus | last post by:
I'm implementing entity object which should populate its properties from database when property is first referenced. In RDL reports I use object properties like MyObject.MyProperty MyObject...
10
by: Rob | last post by:
I am reading a book that says that the "name" property can be altered only at design time and cannot be modified at runtime. Please explain this given the code below... If you click Button3......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.