Click here to Skip to main content
15,908,775 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to new vertical form Pin
fsdsc212-Mar-15 5:37
fsdsc212-Mar-15 5:37 
GeneralRe: how to new vertical form Pin
BillWoodruff12-Mar-15 18:32
professionalBillWoodruff12-Mar-15 18:32 
First, I'd define a public Property on your 'sub Form that allowed me to set and get the SplitContainer's 'Orientation property:
C#
public Orientation CurrentSplitterOrientation
{
    set { splitContainer1.Orientation = value; }

    get { return splitContainer1.Orientation; }
}
I'd use a public Property because I'd assume that I would want access the current value of 'Orientation, as well as set it.

In the Main MDI Form, you can "release" the MdiChildForm by setting its 'MdiParent property to 'null:

C#
private SubForm1 subForm1 = new SubForm1();

private void Form1_Load(object sender, EventArgs e)
{
    subForm1.MdiParent = this;
    subForm1.Show();

}

private void button1_Click_1(object sender, EventArgs e)
{
    subForm1.MdiParent = null;
    subForm1.CurrentSplitterOrientation = Orientation.Vertical;
}
I'd like to suggest you consider the following:

1. MDI architecture is now really out-dated, and if you have the choice, I suggest you don't use it.

2. Putting any Control on the MDI Parent Form itself, except maybe a ToolStripMenu, is generally a bad idea.

3. Changing a Form's status from being an 'MdiChildForm to being "just another" Form on the Desktop is ... well ... unusual. This may be confusing to your end-users. You might consider, instead of an MDI Parent to Child relationship, using the 'Owner property of the secondary Form ... set it to the Main Form, instead. A Form which has an 'Owner is guaranteed to remain in front of its'Owner Form.
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"

GeneralRe: how to new vertical form Pin
fsdsc213-Mar-15 4:56
fsdsc213-Mar-15 4:56 
Questiona problem Pin
Akbar Fardi10-Mar-15 11:29
Akbar Fardi10-Mar-15 11:29 
AnswerRe: a problem Pin
Garth J Lancaster10-Mar-15 12:23
professionalGarth J Lancaster10-Mar-15 12:23 
AnswerRe: a problem Pin
manchanx10-Mar-15 13:25
professionalmanchanx10-Mar-15 13:25 
QuestionEmbed Image n Email Pin
Jassim Rahma10-Mar-15 10:37
Jassim Rahma10-Mar-15 10:37 
AnswerRe: Embed Image n Email Pin
Eddy Vluggen10-Mar-15 10:53
professionalEddy Vluggen10-Mar-15 10:53 
AnswerRe: Embed Image n Email Pin
Richard Deeming11-Mar-15 2:56
mveRichard Deeming11-Mar-15 2:56 
QuestionHow to cancel the change in a TextBox after I click on the Cancel button on a form, which was hidden form? Pin
pvpeng10-Mar-15 5:25
pvpeng10-Mar-15 5:25 
AnswerRe: How to cancel the change in a TextBox after I click on the Cancel button on a form, which was hidden form? Pin
Richard MacCutchan10-Mar-15 5:57
mveRichard MacCutchan10-Mar-15 5:57 
AnswerRe: How to cancel the change in a TextBox after I click on the Cancel button on a form, which was hidden form? Pin
Eddy Vluggen10-Mar-15 8:35
professionalEddy Vluggen10-Mar-15 8:35 
AnswerRe: How to cancel the change in a TextBox after I click on the Cancel button on a form, which was hidden form? Pin
BillWoodruff10-Mar-15 19:46
professionalBillWoodruff10-Mar-15 19:46 
QuestionHow to display just a part of a JPEG image Pin
Member 113687599-Mar-15 23:11
Member 113687599-Mar-15 23:11 
AnswerRe: How to display just a part of a JPEG image Pin
Gerry Schmitz10-Mar-15 1:27
mveGerry Schmitz10-Mar-15 1:27 
QuestionDisplay just a part of an image Pin
Member 113687599-Mar-15 23:10
Member 113687599-Mar-15 23:10 
QuestionWhat is the best practice for push database change notification Pin
Tridip Bhattacharjee9-Mar-15 3:41
professionalTridip Bhattacharjee9-Mar-15 3:41 
AnswerRe: What is the best practice for push database change notification Pin
Eddy Vluggen9-Mar-15 4:15
professionalEddy Vluggen9-Mar-15 4:15 
GeneralRe: What is the best practice for push database change notification Pin
Tridip Bhattacharjee9-Mar-15 4:33
professionalTridip Bhattacharjee9-Mar-15 4:33 
GeneralRe: What is the best practice for push database change notification Pin
F-ES Sitecore9-Mar-15 5:29
professionalF-ES Sitecore9-Mar-15 5:29 
GeneralRe: What is the best practice for push database change notification Pin
Tridip Bhattacharjee9-Mar-15 21:25
professionalTridip Bhattacharjee9-Mar-15 21:25 
GeneralRe: What is the best practice for push database change notification Pin
Gerry Schmitz10-Mar-15 1:16
mveGerry Schmitz10-Mar-15 1:16 
GeneralRe: What is the best practice for push database change notification Pin
Tridip Bhattacharjee10-Mar-15 3:15
professionalTridip Bhattacharjee10-Mar-15 3:15 
GeneralRe: What is the best practice for push database change notification Pin
Gerry Schmitz10-Mar-15 11:35
mveGerry Schmitz10-Mar-15 11:35 
GeneralRe: What is the best practice for push database change notification Pin
Eddy Vluggen9-Mar-15 6:52
professionalEddy Vluggen9-Mar-15 6:52 

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.