Windows Develop Bookmark and Share   
 index > Windows Forms General > Open Child form
 

Open Child form

Hello all,

I have 3 simple forms:

1. Main form (MDI Container)
2. Search Form (Child)
3. Record Form (Child)

I want to open the Record Form using code that is in the Search Form. And both of them
will be MDI children to the Main form.

Any ideas?
Thanks in advance.
Richard M.
MigrationUser 1  Saturday, September 11, 2004 6:18 PM
what do you mean using code that is in the Search form? Do you mean a search phrase?
MigrationUser 1  Tuesday, September 14, 2004 4:01 PM
open your search form from your record form

in your record form:
private button_showsearch click_event(......)
{
   searchForm sf = new searchForm();
   sf.ShowDialog();

   // Put your code here to bind the records to your datagrid or etc based on your search
   // phrase in your search form.
}
MigrationUser 1  Monday, October 04, 2004 11:40 PM
still ur question is not understandable, do u want to open the Record form(child) from Search Form(child), if so

step 1 : create object of record form
step 2 : call show or showdialog() method of object created in step 1.

RecordForm _mobjrec;

_mobjrec = new RecordForm();
_mobjrec.show(); or _mobjec.showDialog();

MigrationUser 1  Sunday, October 10, 2004 8:35 AM
the problem is not solved, when _mobjrec is showed, check mdiparent of him, nothing is the result
MigrationUser 1  Sunday, January 16, 2005 12:36 PM
In Search form write this code


RecordForm rForm = new RecordForm;
rForm.MdiParent=this.MdiParent;
rForm.show() or ShowDialog();

I think this will work..

MigrationUser 1  Tuesday, February 15, 2005 6:16 AM

You can use google to search for other answers

Custom Search

More Threads

• Concatenate string and button object
• need help with properties while creating usercontrol
• How to display properties in different colors on a PropertyGrid
• Method Hangs Until Prgram Exit
• Datagrid
• AutoScaleMode.Font and FormBorderStyle.FixedSingle incompatible
• adding a combo box to toolbar
• Developing AutoComplete Editor similar to VS.NET
• The type initializer for 'PublicVariables Module' threw an exception
• "Alt+TAB" Form Problem