Re: problem with modeless dialog
- From: "Bruce Wood" <brucewood@xxxxxxxxxx>
- Date: 27 Jul 2006 10:53:27 -0700
proit_123@xxxxxxxxxxx wrote:
I am working on a windows forms application and have the following
requirement.
I have two projects in my application Project A and Project B. And
Project A has the reference of Project B. I need to display a modeless
dialog from the main form which is in Project A and the modeless dialog
to be raised is in Project B. After closing the modeless dialog i need
to pass a value from modeless dialog to the main form of Project A and
also i need to execute a method in the main form with that value.
(the problem is i can not able to create an object of the main form
because Project B has no reference of Project A)
In your main form in project A:
ModelessDialog md = new ModelessDialog();
md.Closing += new CancelEventHandler(this.ModelessDialogClosing);
md.Show();
then:
private void ModelessDialogClosing(object sender, CancelEventArgs e)
{
ModelessDialog closingMd = (ModelessDialog)sender;
MainFormMethod(closingMd.ValueFromModelessDialog);
}
or something like that.
.
- Follow-Ups:
- Re: problem with modeless dialog
- From: proit_123
- Re: problem with modeless dialog
- From: proit_123
- Re: problem with modeless dialog
- References:
- problem with modeless dialog
- From: proit_123
- problem with modeless dialog
- Prev by Date: Re: Aligning controls with each other at runtime
- Next by Date: Re: Control Right Click Selection
- Previous by thread: Re: problem with modeless dialog
- Next by thread: Re: problem with modeless dialog
- Index(es):
Relevant Pages
|