Passing a Parameter to the LaunchDialog Method


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I would like to present a list of orders to the user. If the user double-click an order in the list, the order maintenance window will open and the BO will be populated with the primary key being passed to it. I have done this in a number of situations outside of the StratFlix-like application. Now, I would like to do the same but take advantage of the code already existing. The LaunchDialog looks like this:





private void LaunchDialog(Type dialogType)

{

    //-- Establish Locals

    Form f = (Form)(Activator.CreateInstance(dialogType));



    //-- Add the handlers to the form

    AddFormHandlers(f);



    //-- Set the parent MDI

    f.MdiParent = this;



    //-- Show the dialog

    f.Show();

}





How would I pass the primary key via the Activator.CreateInstance method? I'll start researching it and testing. Hopefully, someone here will be able to shave off some of my R&D time (so I can get to R&R quicker!).



Thanks!!

Bill
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Bill Cunnien - 14 Years Ago
Greg McGuffey - 14 Years Ago
Bill Cunnien - 14 Years Ago
Greg McGuffey - 14 Years Ago
Bill Cunnien - 14 Years Ago
                         Nice Bill!

Another way this could be handled would be to...
Greg McGuffey - 14 Years Ago
                             Thanks Bill.

[quote][b]Greg McGuffey (05/21/2010)[/b][hr]If...
Edhy Rijo - 14 Years Ago
                                 OK, here's the sample. Notice that there is almost no code in the...
Greg McGuffey - 14 Years Ago
                                     Edhy, you might have missed this with the servers being down....
Greg McGuffey - 14 Years Ago
                                         [quote][b]Greg McGuffey (05/24/2010)[/b][hr]Edhy, you might have...
Edhy Rijo - 14 Years Ago
                                             Hmmmm, this is C# :w00t:, are you sending me some hidden message so I...
Edhy Rijo - 14 Years Ago
                                                 The message was hidden! I didn't mean for it to hidden. :P
...
Greg McGuffey - 14 Years Ago
Russell Scott Brown - 14 Years Ago
Edhy Rijo - 14 Years Ago
Greg McGuffey - 14 Years Ago
Russell Scott Brown - 14 Years Ago
Edhy Rijo - 14 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search