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

Deleting and creating controls via code

Hi

Is it possible to enumerate all controls on a form and then save the info in
an xml file via code? Is it possible to reverse the process i.e. read info
from and xml and recreate all controls on a blank form? I am just trying to
find a way to cerate "templates" so users can choose which controls they
want to see and with what attributes; position, size, colour etc.

A code example would be great.

Many Thanks

Regards

Jun 20 '07 #1
1 1073
On Jun 20, 2:34 pm, "John" <J...@nospam.infovis.co.ukwrote:
Hi

Is it possible to enumerate all controls on a form and then save the info in
an xml file via code? Is it possible to reverse the process i.e. read info
from and xml and recreate all controls on a blank form? I am just trying to
find a way to cerate "templates" so users can choose which controls they
want to see and with what attributes; position, size, colour etc.

A code example would be great.
I don't have time to enter a bunch of sample code, but I think I can
point you in the right direction. The Form Class has a property that
is a collection of all controls on the form, so yes, you could
enumerate all controls on a form. Depending on how complex you expect
your forms to be, you need to remember that a form can be the parent
of a collection of controls. To write the out to XML, you need to
figure out the XMLSerializer Class, it ain't too hard, I figured it
out in just a couple of days. It is my impression that all classes are
serializable by default in VB but I could be wrong, you may have to
create a copy of the control object in order to serialize it (write it
to XML file using XMLSerializer class).

Everything you need to know plus sample code is all in the help files.

Jun 20 '07 #2

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

Similar topics

3
by: kris.dorey | last post by:
Hi, Ive got the following code which seems ok but when the user runs the function for a second time I get an error message stating that the mdb is in use by another process. There is still an...
0
by: Mike P | last post by:
Can anybody tell me what is wrong with this code? The main error I seem to be getting is where I am creating the LinkButton called deleteButton. public void dgLog_ItemDataBound(object sender,...
2
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
6
by: Martin Bischoff | last post by:
Hi, I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123) to allow users to upload files. When I later delete these directories (from the code behind), the application...
3
by: Wayne | last post by:
1. I have created my own class that inherits the textbox (called it CyanFocusTextBox). I put in some code and some new properties. All this works. I build the dll that contains this class...
3
by: meh | last post by:
Hi All; After creating a new tab if I delete the tab I cannot close my app from the X in the upper right of the window. NE1 have a clue why. Tried stepping through the delete seems to work fine...
3
gauravgmbhr
by: gauravgmbhr | last post by:
hi friends I have been doing testing on an existing project The tables in postgresQl Db has some trigger function using keyword 'DELETING' IF DELETING THEN SOME SELECT STATEMENT...
1
by: John | last post by:
Hi Is it possible to enumerate all controls on a form and then save the info in an xml file via code? Is it possible to reverse the process i.e. read info from and xml and recreate all controls...
4
by: sphinney | last post by:
I'm not exactly sure how to start this post. My question is pretty simple, but it will take a little bit of context before I can state it. (And thanks in advance for taking the time to read this!) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.