Click here to Skip to main content
15,891,675 members
Home / Discussions / C#
   

C#

 
GeneralRe: Progress Bar Pin
Heath Stewart13-May-04 17:21
protectorHeath Stewart13-May-04 17:21 
GeneralRe: Progress Bar Pin
The_Soul_Of_Rock13-May-04 17:44
The_Soul_Of_Rock13-May-04 17:44 
GeneralRe: Progress Bar Pin
LongRange.Shooter14-May-04 8:25
LongRange.Shooter14-May-04 8:25 
GeneralExplanation about Properties Pin
Rostrox13-May-04 13:04
Rostrox13-May-04 13:04 
GeneralRe: Explanation about Properties Pin
Heath Stewart13-May-04 13:20
protectorHeath Stewart13-May-04 13:20 
GeneralRe: Explanation about Properties Pin
pgraeve13-May-04 15:11
pgraeve13-May-04 15:11 
GeneralRe: Explanation about Properties Pin
Heath Stewart13-May-04 16:52
protectorHeath Stewart13-May-04 16:52 
GeneralAdding Rows to Dataset Pin
MrJJKoolJ13-May-04 12:37
MrJJKoolJ13-May-04 12:37 
GeneralRe: Adding Rows to Dataset Pin
MrJJKoolJ13-May-04 12:59
MrJJKoolJ13-May-04 12:59 
GeneralRe: Adding Rows to Dataset Pin
Heath Stewart13-May-04 13:04
protectorHeath Stewart13-May-04 13:04 
GeneralRe: Adding Rows to Dataset Pin
MrJJKoolJ13-May-04 13:22
MrJJKoolJ13-May-04 13:22 
GeneralRe: Adding Rows to Dataset Pin
Heath Stewart13-May-04 13:29
protectorHeath Stewart13-May-04 13:29 
GeneralRe: Adding Rows to Dataset Pin
Heath Stewart13-May-04 13:07
protectorHeath Stewart13-May-04 13:07 
GeneralSys Monitor graphs Pin
Ashwin C13-May-04 11:27
Ashwin C13-May-04 11:27 
GeneralRe: Sys Monitor graphs Pin
Heath Stewart13-May-04 11:49
protectorHeath Stewart13-May-04 11:49 
Generalregistry permissions Pin
elena1234513-May-04 10:36
elena1234513-May-04 10:36 
GeneralRe: registry permissions Pin
Heath Stewart13-May-04 10:56
protectorHeath Stewart13-May-04 10:56 
GeneralRe: registry permissions Pin
elena1234513-May-04 11:31
elena1234513-May-04 11:31 
GeneralRe: registry permissions Pin
Heath Stewart13-May-04 11:35
protectorHeath Stewart13-May-04 11:35 
GeneralRe: registry permissions Pin
Heath Stewart13-May-04 10:59
protectorHeath Stewart13-May-04 10:59 
GeneralMDI Client Pin
Agent 8613-May-04 10:07
Agent 8613-May-04 10:07 
I have created a user control, on which I have place an MDI Client control. I next added my control to a project. Now, I want to open new Forms inside of the Client. Here is my problem:

childForm myChild = new childForm(); //Creating a form to be added to the MdiClient <br />
mdi1.m.Controls.Add(myChild); //mdi1 is the user control, m is the publically accessible MDI Client <br />
<br />
myChild.Show(); //Shows the form <br />

The error occurs here:
<br />
mdi1.m.Controls.Add(myChild); <br />

this is the error:

An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll 

Additional information: Can only add MDI child forms to an MdiClient.

The only way I can currently get around this is to make my main form an MDI Parent, and add this code before adding the form to the user control:
<br />
myChild.MdiParent = this; <br />

Then, when I try to add the form to the user control, it works beautifully. I can only assume that this is because the Form.IsMdiChild property is set to TRUE.
But, I need to do this without first adding it to an MDI Parent (making my main form an MDI Parent.)
So my question is:

1) Is there a way to write to the Form.IsMdiChild value?

or

2) Is there another way to do this?

Hopefully, this problem will interest somebody... Thanks.

Agent 86
GeneralRe: MDI Client Pin
Dave Kreskowiak13-May-04 12:01
mveDave Kreskowiak13-May-04 12:01 
GeneralCreating Dataset Pin
MrJJKoolJ13-May-04 10:06
MrJJKoolJ13-May-04 10:06 
GeneralRe: Creating Dataset Pin
Heath Stewart13-May-04 11:07
protectorHeath Stewart13-May-04 11:07 
GeneralRe: Creating Dataset Pin
MrJJKoolJ13-May-04 11:12
MrJJKoolJ13-May-04 11:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.