473,382 Members | 1,078 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,382 software developers and data experts.

Load & Save Controls

Hi, I was wondering if I could save all of the controls in a
tabcontrol for example, complete with the controls' name, text, value,
position, size, etc..

Then when the user opens the application again, and hits the Load
Button, it would load all the controls to the tabcontrol intact, this
is done via code of course.

How do I go about this? Looping all controls in the tabcontrol and
saving all of its information in a text file? xml file? Then when
loading just do a lot of "If" statements searching for keywords at the
saved text or xml file??

I guess that would be doable,..however, is there a "standard" way for
this? Or better yet an example that I could get a good look at on how
to go around this problem? Or the solution is easy and no example is
required?

Thanks again,
Henry
Nov 21 '05 #1
5 1165
Are the number of controls likley to differ between saves ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Henry Wu" <he***********@hotmail.com> wrote in message
news:86*************************@posting.google.co m...
Hi, I was wondering if I could save all of the controls in a
tabcontrol for example, complete with the controls' name, text, value,
position, size, etc..

Then when the user opens the application again, and hits the Load
Button, it would load all the controls to the tabcontrol intact, this
is done via code of course.

How do I go about this? Looping all controls in the tabcontrol and
saving all of its information in a text file? xml file? Then when
loading just do a lot of "If" statements searching for keywords at the
saved text or xml file??

I guess that would be doable,..however, is there a "standard" way for
this? Or better yet an example that I could get a good look at on how
to go around this problem? Or the solution is easy and no example is
required?

Thanks again,
Henry

Nov 21 '05 #2
> Are the number of controls likley to differ between saves ?

Yes, the number of controls will differ, because there are buttons
that would add extra tabpages, which in each tabpage has a set of
controls.

Do you have something in mind that may be able to help me out?

Thanks,
Henry
Nov 21 '05 #3
Well, I think you have the basic idea anyway. All controls have the Size and
Location properties so you could do something like this. And do something
similar on Form_Load in reverse

Dim tab as Control
Dim innerC as Control
For Each c as Control in Me.Controls

if TypeOf c Is TabPage Then

'Sace c.Size
'Save c.Location

For Each innerC in c.Controls

'Save innerC.Size
'Save innerC.Location
'Save innerC.Name

Next
End If

Next



--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Henry C. Wu" <he***********@gmail.com> wrote in message
news:44**************************@posting.google.c om...
Are the number of controls likley to differ between saves ?


Yes, the number of controls will differ, because there are buttons
that would add extra tabpages, which in each tabpage has a set of
controls.

Do you have something in mind that may be able to help me out?

Thanks,
Henry

Nov 21 '05 #4
Hi,..im just thinking out of the box here,..is there a way that I
could do the following
1. Loop through all the controls i would like to save
2. Save all the properties,values,txt,etc of the controls in a control
array variable
3. Save the control array variable at a text file
4. Then when needed, one can do a control_array_variable = text_file ,
then loop through the control array variable to display the saved
controls again.

Thanks,
Henry
Nov 21 '05 #5
Henry,

In addition to OHM, there are two posibilities, serialize the controls or
saving the properties, where I would as OHM showed would go for just saving
the properties in a routine as he showed.

My expirience is that the on disk written dataset is the best place to save
these settings when they are as many as you describe. When it would only be
the form height and place, I would go for the registry.

I hope this addition helps as well?

Cor
Nov 21 '05 #6

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

Similar topics

2
by: Ray | last post by:
Hi I have designed a database app using a windows form and a tab control with comboboxes and edit controls on each tab control. The problem that I am having is with the edit form that I have...
0
by: Josema | last post by:
Hi to all, I have a webform.aspx and inside i have a dropdown list with autopostback and a place holder... Depending of the selected index that the user selects in the dropdownlist i load a...
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
0
by: Frank 'Olorin' Rizzi | last post by:
Hello everyone. This is quite convoluted, but I'll try to make it simple. I have a couple of bottom-line questions (I guess): 1~ what happens between the Page_Load routine in the code behind...
1
by: et | last post by:
I. Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For...
1
by: Irene | last post by:
Hello all! I'm creating a web site in ASP.NET (VB.NET). One of the requirements was to allow users to create orders going through several steps. A must have is to have an option to save the work...
6
by: sck10 | last post by:
Hello, I have applications that produce the following error when they have been open to long without activity. Is there any way to force a re-load of the page or go to another page if the page...
2
by: sck10 | last post by:
Hello, I have a web page that has a GridView and a FormView, each in its own panel. The GridView shows a list of records in a database. When a row in the GridView is selected the FormView...
0
by: nithagowda | last post by:
Hello, I have a DropDownList for source type and a panel for displaying TreeView based on the source type.. The problem is- if i select different source type drom ddlSrcType, other than the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.