From 0358914363282fb51785c5cd5e7c3ffba6fa31af Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:07:43 -0800 Subject: [PATCH] Upgrade framework winforms-outlook article (#1280) * upgrade winforms-outlook article * change readme name; add description * change readme name; add description --- ...ipane-user-interface-with-windows-forms.md | 206 +++++------------- .../form.png | Bin 0 -> 5509 bytes .../Form1.Designer.cs | 147 +++++++++++++ .../Form1.cs | 16 ++ .../Form1.resx | 120 ++++++++++ .../Program.cs | 22 ++ .../project.csproj | 65 ++++++ .../readme.txt | 1 + 8 files changed, 420 insertions(+), 157 deletions(-) create mode 100644 dotnet-desktop-guide/framework/winforms/controls/media/how-to-create-a-multipane-user-interface-with-windows-forms/form.png create mode 100644 dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.Designer.cs create mode 100644 dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.cs create mode 100644 dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.resx create mode 100644 dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Program.cs create mode 100644 dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/project.csproj create mode 100644 dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/readme.txt diff --git a/dotnet-desktop-guide/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms.md b/dotnet-desktop-guide/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms.md index 6e1039d..5647387 100644 --- a/dotnet-desktop-guide/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms.md +++ b/dotnet-desktop-guide/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms.md @@ -1,6 +1,7 @@ --- title: Create a Multipane User Interface -ms.date: "03/30/2017" +description: Describes how to layout Windows Forms controls to mimic a Microsoft Outlook email application. +ms.date: 01/21/2022 dev_langs: - "csharp" - "vb" @@ -14,162 +15,53 @@ helpviewer_keywords: ms.assetid: e79f6bcc-3740-4d1e-b46a-c5594d9b7327 --- # How to: Create a Multipane User Interface with Windows Forms -In the following procedure, you will create a multipane user interface that is similar to the one used in Microsoft Outlook, with a **Folder** list, a **Messages** pane, and a **Preview** pane. This arrangement is achieved chiefly through docking controls with the form. - - When you dock a control, you determine which edge of the parent container a control is fastened to. Thus, if you set the property to , the right edge of the control will be docked to the right edge of its parent control. Additionally, the docked edge of the control is resized to match that of its container control. For more information about how the property works, see [How to: Dock Controls on Windows Forms](how-to-dock-controls-on-windows-forms.md). - - This procedure focuses on arranging the and the other controls on the form, not on adding functionality to make the application mimic Microsoft Outlook. - - To create this user interface, you place all the controls within a control, which contains a control in the left-hand panel. The right-hand panel of the control contains a second control with a control above a control. These controls enable independent resizing of the other controls on the form. You can adapt the techniques in this procedure to craft custom user interfaces of your own. - -### To create an Outlook-style user interface programmatically - -1. Within a form, declare each control that comprises your user interface. For this example, use the , , , and controls to mimic the Microsoft Outlook user interface. - - ```vb - Private WithEvents treeView1 As System.Windows.Forms.TreeView - Private WithEvents listView1 As System.Windows.Forms.ListView - Private WithEvents richTextBox1 As System.Windows.Forms.RichTextBox - Private WithEvents splitContainer1 As _ - System.Windows.Forms.SplitContainer - Private WithEvents splitContainer2 As _ - System.Windows.Forms.SplitContainer - ``` - - ```csharp - private System.Windows.Forms.TreeView treeView1; - private System.Windows.Forms.ListView listView1; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.Windows.Forms. SplitContainer splitContainer2; - private System.Windows.Forms. SplitContainer splitContainer1; - ``` - -2. Create a procedure that defines your user interface. The following code sets the properties so that the form will resemble the user interface in Microsoft Outlook. However, by using other controls or docking them differently, it is just as easy to create other user interfaces that are equally flexible. - - ```vb - Public Sub CreateOutlookUI() - ' Create an instance of each control being used. - Me.components = New System.ComponentModel.Container() - Me.treeView1 = New System.Windows.Forms.TreeView() - Me.listView1 = New System.Windows.Forms.ListView() - Me.richTextBox1 = New System.Windows.Forms.RichTextBox() - Me.splitContainer1 = New System.Windows.Forms.SplitContainer() - Me.splitContainer2= New System.Windows.Forms. SplitContainer() - - ' Should you develop this into a working application, - ' use the AddHandler method to hook up event procedures here. - - ' Set properties of TreeView control. - ' Use the With statement to avoid repetitive code. - With Me.treeView1 - .Dock = System.Windows.Forms.DockStyle.Fill - .TabIndex = 0 - .Nodes.Add("treeView") - End With - - ' Set properties of ListView control. - With Me.listView1 - .Dock = System.Windows.Forms.DockStyle.Top - .TabIndex = 2 - .Items.Add("listView") - End With - - ' Set properties of RichTextBox control. - With Me.richTextBox1 - .Dock = System.Windows.Forms.DockStyle.Fill - .TabIndex = 3 - .Text = "richTextBox1" - End With - - ' Set properties of the first SplitContainer control. - With Me.splitContainer1 - .Dock = System.Windows.Forms.DockStyle.Fill - .TabIndex = 1 - .SplitterWidth = 4 - .SplitterDistance = 150 - .Orientation = Orientation.Horizontal - .Panel1.Controls.Add(Me.listView1) - .Panel2.Controls.Add(Me.richTextBox1) - End With - - ' Set properties of the second SplitContainer control. - With Me.splitContainer2 - .Dock = System.Windows.Forms.DockStyle.Fill - .TabIndex = 4 - .SplitterWidth = 4 - .SplitterDistance = 100 - .Panel1.Controls.Add(Me.treeView1) - .Panel2.Controls.Add(Me.SplitContainer1) - End With - - ' Add the main SplitContainer control to the form. - Me.Controls.Add(Me.splitContainer2) - Me.Text = "Intricate UI Example" - End Sub - ``` - - ```csharp - public void createOutlookUI() - { - // Create an instance of each control being used. - treeView1 = new System.Windows.Forms.TreeView(); - listView1 = new System.Windows.Forms.ListView(); - richTextBox1 = new System.Windows.Forms.RichTextBox(); - splitContainer2 = new System.Windows.Forms.SplitContainer(); - splitContainer1 = new System.Windows.Forms.SplitContainer(); - - // Insert code here to hook up event methods. - - // Set properties of TreeView control. - treeView1.Dock = System.Windows.Forms.DockStyle.Fill; - treeView1.TabIndex = 0; - treeView1.Nodes.Add("treeView"); - - // Set properties of ListView control. - listView1.Dock = System.Windows.Forms.DockStyle.Top; - listView1.TabIndex = 2; - listView1.Items.Add("listView"); - - // Set properties of RichTextBox control. - richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; - richTextBox1.TabIndex = 3; - richTextBox1.Text = "richTextBox1"; - - // Set properties of first SplitContainer control. - splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - splitContainer2.TabIndex = 1; - splitContainer2.SplitterWidth = 4; - splitContainer2.SplitterDistance = 150; - splitContainer2.Orientation = Orientation.Horizontal; - splitContainer2.Panel1.Controls.Add(this.listView1); - splitContainer2.Panel1.Controls.Add(this.richTextBox1); - - // Set properties of second SplitContainer control. - splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - splitContainer2.TabIndex = 4; - splitContainer2.SplitterWidth = 4; - splitContainer2.SplitterDistance = 100; - splitContainer2.Panel1.Controls.Add(this.treeView1); - splitContainer2.Panel1.Controls.Add(this.splitContainer1); - - // Add the main SplitContainer control to the form. - this.Controls.Add(this.splitContainer2); - this.Text = "Intricate UI Example"; - } - ``` - -3. In Visual Basic, add a call to the procedure you just created in the `New()` procedure. In Visual C#, add this line of code to the constructor for the form class. - - ```vb - ' Add this to the New procedure. - CreateOutlookUI() - ``` - - ```csharp - // Add this to the form class's constructor. - createOutlookUI(); - ``` - + +By arranging controls on a form, you can create a multi-pane user interface that's similar to the one used in Microsoft Outlook, with a **Folder** list, a **Messages** pane, and a **Preview** pane. This arrangement is achieved chiefly through docking controls with the form. + +When you dock a control, you determine which edge of the parent container a control is fastened to. If you set the property to , the right edge of the control will be docked to the right edge of its parent control. Additionally, the docked edge of the control is resized to match that of its container control. For more information about how the property works, see [How to: Dock Controls on Windows Forms](how-to-dock-controls-on-windows-forms.md). + +This procedure focuses on arranging the and the other controls on the form, not on adding functionality to make the application mimic Microsoft Outlook. + +:::image type="content" source="media/how-to-create-a-multipane-user-interface-with-windows-forms/form.png" alt-text="A form that's designed to look like an Outlook mail window."::: + +To create this user interface, you place all the controls within a control. The `SplitContainer` contains a control in the left-hand panel and another `SplitContainer` on the right-hand panel. The second `SplitContainer` contains a control on top and a control on the bottom. + +These controls enable independent resizing of the other controls on the form. You can adapt the techniques in this procedure to craft custom user interfaces of your own. + +## Control layout + +The following table describes how the controls are configured to mimic Microsoft Outlook: + +| Control | Property | Value | +|----------------|------------------|--------------------------------------------------| +| SplitContainer | Name | `splitContainer1` | +| | Dock | `Fill` | +| | TabIndex | `4` | +| | SplitterWidth | `4` | +| | SplitterDistance | `100` | +| | Panel1.Controls | Add the `treeView1` control to this panel. | +| | Panel2.Controls | Add the `splitContainer2` control to this panel. | +| TreeView | Name | `treeView1` | +| | Dock | `Fill` | +| | TabIndex | `0` | +| | Nodes | Add a new node named `Node0` | +| SplitContainer | Name | `splitContainer2` | +| | Dock | `Fill` | +| | TabIndex | `1` | +| | SplitterWidth | `4` | +| | SplitterDistance | `150` | +| | Orientation | `Horizontal` | +| | Panel1.Controls | Add the `listView1` control to this panel. | +| | Panel2.Controls | Add the `richTextBox1` control to this panel. | +| ListView | Name | `listView1` | +| | Dock | `Fill` | +| | TabIndex | `2` | +| | Items | Add a new item and set the text to `item1`. | +| RichTextBox | Name | `richTextBox1` | +| | Dock | `Fill` | +| | TabIndex | `3` | +| | Text | `richTextBox1` | + ## See also - diff --git a/dotnet-desktop-guide/framework/winforms/controls/media/how-to-create-a-multipane-user-interface-with-windows-forms/form.png b/dotnet-desktop-guide/framework/winforms/controls/media/how-to-create-a-multipane-user-interface-with-windows-forms/form.png new file mode 100644 index 0000000000000000000000000000000000000000..c916fe2fac7be9cb224322ef4945e71d2103f678 GIT binary patch literal 5509 zcmeI0cTm$=yT^ZGUlmlOC6rxQ8%>cHL8=8o7X<`D37sIYv{0oa6m_K}B*?PTq%1^5 z2q6SXs0k>LfKnC_A}ygTMXFg!fE3>NwmW<0-nsYA>^t+`x%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ZQ0 zIPl+z`+vZ4|6WIw=ZGFO|AW`d3r7w(@?TI$|5>&52W|Bwxu(YMZ#nkm==Aser38aC zPNLK%%Rd#BCjo$-3~yrztwwCR;P2oX2~nx8tVj~oW-`~krQ#q@wP0plb#HG;11)x& z;}0cD=J3OjOjnsA>T+K63YA-KD@tIxsOvN(>M*4S5UG@Um(A1e+fyG&F!M+dkeI5f zc#lmEaJYnqtU=x_5S!ghV%Plm8@0_E_=OiwgHhn%y5ffXcYWpN4vgykD@1JG#lVk8 z(b5{_SRj#vnyo@XUSCTVf1&~5x4+3MFo?>^fCM&1t!S3kvEtxX^0JpssO;Z4nw&0A zFfMr4nVJDnSKAFJ$%*=CMu?5J&!0n@wq~Ach0k>5h&pDso?ax3LRryMm~9e_@wP+N zSkW-L3h9C0Z1XY*`}IZ)t}Nb!(8*ds(umA0J~VTp_d(eV54qg*diD9V&1SsoB9Vin z(K_P^W$~DH0g4d)G|9{9^E{rY>9D)hsz{LxB^<7R5~Oz|8n + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("Node0"); + System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("item1"); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.treeView1 = new System.Windows.Forms.TreeView(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.listView1 = new System.Windows.Forms.ListView(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.Panel2.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.treeView1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.splitContainer2); + this.splitContainer1.Size = new System.Drawing.Size(448, 366); + this.splitContainer1.SplitterDistance = 100; + this.splitContainer1.TabIndex = 1; + // + // treeView1 + // + this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeView1.Location = new System.Drawing.Point(0, 0); + this.treeView1.Name = "treeView1"; + treeNode1.Name = "Node0"; + treeNode1.Text = "Node0"; + this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] { + treeNode1}); + this.treeView1.Size = new System.Drawing.Size(100, 366); + this.treeView1.TabIndex = 0; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(0, 0); + this.splitContainer2.Name = "splitContainer2"; + this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.listView1); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.richTextBox1); + this.splitContainer2.Size = new System.Drawing.Size(344, 366); + this.splitContainer2.SplitterDistance = 156; + this.splitContainer2.TabIndex = 1; + // + // listView1 + // + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.HideSelection = false; + this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { + listViewItem1}); + this.listView1.Location = new System.Drawing.Point(0, 0); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(344, 156); + this.listView1.TabIndex = 2; + this.listView1.UseCompatibleStateImageBehavior = false; + // + // richTextBox1 + // + this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.richTextBox1.Location = new System.Drawing.Point(0, 0); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(344, 206); + this.richTextBox1.TabIndex = 3; + this.richTextBox1.Text = "richTextBox1"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(448, 366); + this.Controls.Add(this.splitContainer1); + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "Form1"; + this.Text = "Form1"; + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); + this.splitContainer2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TreeView treeView1; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.RichTextBox richTextBox1; + } +} + diff --git a/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.cs b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.cs new file mode 100644 index 0000000..a7cac9a --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace project +{ + public partial class Form1 : Form + { + //Windows Form application + public Form1() + { + InitializeComponent(); + } + } +} diff --git a/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.resx b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Program.cs b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Program.cs new file mode 100644 index 0000000..b7580e1 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace project +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/project.csproj b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/project.csproj new file mode 100644 index 0000000..1c2538b --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/project.csproj @@ -0,0 +1,65 @@ + + + + + Debug + AnyCPU + {50B5AD53-1181-46C6-91EE-0E65BADF34E1} + WinExe + project + project + v4.8 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + CurrentArchitecture + CurrentRuntime + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + Form1.cs + + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/readme.txt b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/readme.txt new file mode 100644 index 0000000..47cb859 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/controls/snippets/how-to-create-a-multipane-user-interface-with-windows-forms/readme.txt @@ -0,0 +1 @@ +This code is used to generate the screenshot referenced in the parent article.