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

Cache panels

Hello,

I have build a little application with dynamic usercontrols on a panel.
Sometimes there are 5 userscontrols on the panel, sometimes much more.
It is database driven, everey usercontrol needs to get details from
database.

I've tried to cache some panels in a collection using a key. This gives
me more performance because about of 25 keys will be used randomely.

Here a little indication of the code:

dim col as new collection 'my panels - cache
'On the form I've the mainpanel:
protected withevents mainpanel as new System.windows.forms.panel

private sub createPanel(byval key as string)

dim panel1 as new System.windows.forms.panel

try
mainpanel = col.item("thekey")
return 'yes, success from cache!
catch
'no item in cache
end try

... 'add controls to panel1
... 'add more controls to panel1

'Add this item to cache
col.add("thekey", panel1)

mainpanel = panel1
end sub

-----------------------------------------------------------
Question / problem itself:
Why doesn't this work, when showing a cached panel I see no controls
on the panel! The controls had a reference to nothing? How can I solve
this?

(I've tried to do the same with caching a array of all controls on the
panel, that works fine)

Aug 7 '06 #1
4 1315
A,

Are you familiar with the debug possibilities in Visual Studio Net?

Cor

"A. Haeser" <ah@ttt.nlschreef in bericht
news:11**********************@m79g2000cwm.googlegr oups.com...
Hello,

I have build a little application with dynamic usercontrols on a panel.
Sometimes there are 5 userscontrols on the panel, sometimes much more.
It is database driven, everey usercontrol needs to get details from
database.

I've tried to cache some panels in a collection using a key. This gives
me more performance because about of 25 keys will be used randomely.

Here a little indication of the code:

dim col as new collection 'my panels - cache
'On the form I've the mainpanel:
protected withevents mainpanel as new System.windows.forms.panel

private sub createPanel(byval key as string)

dim panel1 as new System.windows.forms.panel

try
mainpanel = col.item("thekey")
return 'yes, success from cache!
catch
'no item in cache
end try

.. 'add controls to panel1
.. 'add more controls to panel1

'Add this item to cache
col.add("thekey", panel1)

mainpanel = panel1
end sub

-----------------------------------------------------------
Question / problem itself:
Why doesn't this work, when showing a cached panel I see no controls
on the panel! The controls had a reference to nothing? How can I solve
this?

(I've tried to do the same with caching a array of all controls on the
panel, that works fine)

Aug 7 '06 #2
Yes, I'm familiar with it.

Cor Ligthert [MVP] schreef:
A,

Are you familiar with the debug possibilities in Visual Studio Net?

Cor

"A. Haeser" <ah@ttt.nlschreef in bericht
news:11**********************@m79g2000cwm.googlegr oups.com...
Hello,

I have build a little application with dynamic usercontrols on a panel.
Sometimes there are 5 userscontrols on the panel, sometimes much more.
It is database driven, everey usercontrol needs to get details from
database.

I've tried to cache some panels in a collection using a key. This gives
me more performance because about of 25 keys will be used randomely.

Here a little indication of the code:

dim col as new collection 'my panels - cache
'On the form I've the mainpanel:
protected withevents mainpanel as new System.windows.forms.panel

private sub createPanel(byval key as string)

dim panel1 as new System.windows.forms.panel

try
mainpanel = col.item("thekey")
return 'yes, success from cache!
catch
'no item in cache
end try

.. 'add controls to panel1
.. 'add more controls to panel1

'Add this item to cache
col.add("thekey", panel1)

mainpanel = panel1
end sub

-----------------------------------------------------------
Question / problem itself:
Why doesn't this work, when showing a cached panel I see no controls
on the panel! The controls had a reference to nothing? How can I solve
this?

(I've tried to do the same with caching a array of all controls on the
panel, that works fine)
Aug 7 '06 #3
Yes, I'm familiar with it.
>
And did you try it, because the error should be somewhere in your code, now
you show the begin and the end but how can we see where the error is?

Cor

Cor Ligthert [MVP] schreef:
>A,

Are you familiar with the debug possibilities in Visual Studio Net?

Cor

"A. Haeser" <ah@ttt.nlschreef in bericht
news:11**********************@m79g2000cwm.googleg roups.com...
Hello,

I have build a little application with dynamic usercontrols on a panel.
Sometimes there are 5 userscontrols on the panel, sometimes much more.
It is database driven, everey usercontrol needs to get details from
database.

I've tried to cache some panels in a collection using a key. This gives
me more performance because about of 25 keys will be used randomely.

Here a little indication of the code:

dim col as new collection 'my panels - cache
'On the form I've the mainpanel:
protected withevents mainpanel as new System.windows.forms.panel

private sub createPanel(byval key as string)

dim panel1 as new System.windows.forms.panel

try
mainpanel = col.item("thekey")
return 'yes, success from cache!
catch
'no item in cache
end try

.. 'add controls to panel1
.. 'add more controls to panel1

'Add this item to cache
col.add("thekey", panel1)

mainpanel = panel1
end sub

-----------------------------------------------------------
Question / problem itself:
Why doesn't this work, when showing a cached panel I see no controls
on the panel! The controls had a reference to nothing? How can I solve
this?

(I've tried to do the same with caching a array of all controls on the
panel, that works fine)

Aug 7 '06 #4
There is no error, but the panel, loaded from cache will not have /
show the dynamic added controls!

A. Haeser schreef:
Hello,

I have build a little application with dynamic usercontrols on a panel.
Sometimes there are 5 userscontrols on the panel, sometimes much more.
It is database driven, everey usercontrol needs to get details from
database.

I've tried to cache some panels in a collection using a key. This gives
me more performance because about of 25 keys will be used randomely.

Here a little indication of the code:

dim col as new collection 'my panels - cache
'On the form I've the mainpanel:
protected withevents mainpanel as new System.windows.forms.panel

private sub createPanel(byval key as string)

dim panel1 as new System.windows.forms.panel

try
mainpanel = col.item("thekey")
return 'yes, success from cache!
catch
'no item in cache
end try

.. 'add controls to panel1
.. 'add more controls to panel1

'Add this item to cache
col.add("thekey", panel1)

mainpanel = panel1
end sub

-----------------------------------------------------------
Question / problem itself:
Why doesn't this work, when showing a cached panel I see no controls
on the panel! The controls had a reference to nothing? How can I solve
this?

(I've tried to do the same with caching a array of all controls on the
panel, that works fine)
Aug 7 '06 #5

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

Similar topics

0
by: PZ | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PANELS http://oss2005.case.unibz.it Submissions of panels are solicited for the "First...
0
by: PZ | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PANELS http://oss2005.case.unibz.it Submissions of panels are solicited for the "First...
4
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to...
1
by: pfnus | last post by:
Hi, I want to display different forms when the buttons are clicked and all the forms are having different controls on it. So instead of adding new windows forms to the project, i enlarged the...
3
by: Jonas | last post by:
Hi! I have aspx-page where I use multiple panels to make room for more controls than would otherwise fit onto one page. On submit, the controls on all panels, visible or not, should be validated...
1
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the...
0
by: ohadasor | last post by:
Hello, I'm using .NET Framework 2.0. I'm creating several panels, one above the other, with splitters between them. I'm using Splitter and not SplitContainer, because the latter is such a big...
1
by: Ben | last post by:
Hi We have a number of Panels on our windows form, we have controls inside and outside of the panels. I am having problems tabbing between controls, it appers to be when the controls are...
3
by: Andrea Gasperi | last post by:
Hi there not sure if this is the right place but i'm proud to use for the first time the "Managed Newsgroups" feature of my brand new MSDN subscription :-) So here is the problem. I've...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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...

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.