473,395 Members | 1,668 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.

Quite confused on classes/usercontrols...

YYZ
I've got a form. On that form, I load in a usercontrol (dynamically,
at run time, depending on if the users wants it or not). The
usercontrol (we'll call it the Search usercontrol) consists of a few
textboxes, and ANOTHER usercontrol (call it the LoanList usercontrol).

The LoanList usercontrol, depending on how many loans were found in the
search, adds in a THIRD type of usercontrol (the LoanSmallSummary
usercontrol). It may have 0 of these, or it may have 100 of these.
I've got all that working.

Now, when the user double clicks on one of the LoanSmallSummary
usercontrols, I want to, from the users' perspective, clear out the
entire search control (and the loanlist and all the loansmallsummary
controls), and dynamically load in the FOURTH type of usercontrol, the
LoanDisplay usercontrol.

With me so far?

I've got all of that working except the double click part. I can
capture a double click on the LoanSmallSummary, but then I'm assuming
I'll have to raise an event to it's parent control, which is the
LoanList usercontrol. Then the LoanList needs to raise an event on the
Search control, then the search control needs to raise an event on the
Form itself, so that form knows to close the search control completely
(but first get the id of the loan that user wants to view), and then
load in the LoanDisplay control.

I can easily add an event to LoanSmallSummary, but how do I cause my
LoanList control to be able to get it? I don't have any hardcoded
names, just an array of type LoanSmallSummary that point to each of the
dynamically loaded LoanSmallSummaries.

Can anyone point me in the right direction?

I'm new to .Net (using version 2003), but not necessarily to OO
programming -- I started out in PowerBuilder.

Thanks for any and all advice.

Matt

Nov 21 '05 #1
1 792
Adding a new control to the existing UserControl dynamically does not
necessarily mean that it the parent will automatically get events from the
new control. You need to have a valid WithEvents variable assigned to each
new control. Since the controls are dynamic this may be hard to do.
Instead, I would recommend using the VB AddHandler function instead. Call it
for every UserControl you dynamically create.

"YYZ" wrote:
I've got a form. On that form, I load in a usercontrol (dynamically,
at run time, depending on if the users wants it or not). The
usercontrol (we'll call it the Search usercontrol) consists of a few
textboxes, and ANOTHER usercontrol (call it the LoanList usercontrol).

The LoanList usercontrol, depending on how many loans were found in the
search, adds in a THIRD type of usercontrol (the LoanSmallSummary
usercontrol). It may have 0 of these, or it may have 100 of these.
I've got all that working.

Now, when the user double clicks on one of the LoanSmallSummary
usercontrols, I want to, from the users' perspective, clear out the
entire search control (and the loanlist and all the loansmallsummary
controls), and dynamically load in the FOURTH type of usercontrol, the
LoanDisplay usercontrol.

With me so far?

I've got all of that working except the double click part. I can
capture a double click on the LoanSmallSummary, but then I'm assuming
I'll have to raise an event to it's parent control, which is the
LoanList usercontrol. Then the LoanList needs to raise an event on the
Search control, then the search control needs to raise an event on the
Form itself, so that form knows to close the search control completely
(but first get the id of the loan that user wants to view), and then
load in the LoanDisplay control.

I can easily add an event to LoanSmallSummary, but how do I cause my
LoanList control to be able to get it? I don't have any hardcoded
names, just an array of type LoanSmallSummary that point to each of the
dynamically loaded LoanSmallSummaries.

Can anyone point me in the right direction?

I'm new to .Net (using version 2003), but not necessarily to OO
programming -- I started out in PowerBuilder.

Thanks for any and all advice.

Matt

Nov 21 '05 #2

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

Similar topics

4
by: Vladimír Kolesnik | last post by:
Hi there, does anybody know, how to create a class, which is can be inherited by both aspx (System.Web.UI.Page) as well as by ascx (System.Web.UI.UserControl) classes. I have the bunch of same...
4
by: Anders K. Jacobsen [DK] | last post by:
Hi I have some common UserControls i want to share between to sites (on the same mashine but on diffrent virtual paths). right now i have on solution file with aprox 10 projects. 2 of these is...
5
by: Carlo Marchesoni | last post by:
I read that autoeventwireup="false" doesn't cause Page_Load to fire automatically and trying it out with a simple page this can be confirmed easily. However, I have a page with...
7
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows...
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...
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:
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
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...

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.