Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlExec Equivalent?
Message
From
31/10/2007 10:33:09
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Vista
Database:
VistaDB
Miscellaneous
Thread ID:
01265186
Message ID:
01265382
Views:
9
It sounds like the piece that you are missing is just the references between the forms. Doing what you want to do is easy. I just finished modifying some code in a Java system I'm working on right now. And Java and C# are basically the same.

There's a table displayed on the main form. You can highlight a row on the table and click a button to say you want to do some special processing on that row.

The process works as follows:
1) The main form creates a sub-list that contains the selected row, along with other rows from the main table that because of an code column are associated with the selected row.
2) This list is passed to the constructor of the dialog that gets created as part of this process.
3) You perform the operation in another table displayed in the dialog.
4) When you click a button on the dialog to finish, you are returned to the object that the main form resides in.
5) The next line after the line that instantiated the dialog checks to see if the "OK" button was clicked on the dialog.
6) If so, it modifies the main table based on the sublist that was edited in the dialog.
7) The reference to the dialog still exists, even though it is no longer displayed. The main form uses this reference to make method calls that return the necessary information from the edited sublist. And any other information needed from the dialog.

So because both the main form and the dialog are encapsulated, all the information the dialog needs to get properly instantiated needs to get passed in. And all the methods necessary to see what was done while the dialog was open are contained in the dialog class. And can get called from whatever object instantiated the dialog.

>I did put the combobox on my main form for now. I was just trying to learn how to make and call a modal dialog as part of the process of building this app.
>
>Thanks for your help.

(On an infant's shirt): Already smarter than Bush
Previous
Reply
Map
View

Click here to load this message in the networking platform