Commit 9b5304f8 HZH

新增类office导航菜单

1 个父辈 2968253f
...@@ -437,7 +437,7 @@ namespace HZH_Controls.Controls ...@@ -437,7 +437,7 @@ namespace HZH_Controls.Controls
} }
m_lstAnchors[menu] = new FrmAnchor(lbl, panel, point); m_lstAnchors[menu] = new FrmAnchor(lbl, panel, point);
m_lstAnchors[menu].FormClosing += UCNavigationMenu_FormClosing; m_lstAnchors[menu].FormClosing += UCNavigationMenu_FormClosing;
m_lstAnchors[menu].Show(); m_lstAnchors[menu].Show(this);
m_lstAnchors[menu].Size = new Size(size.Width, height); m_lstAnchors[menu].Size = new Size(size.Width, height);
} }
} }
......
...@@ -253,7 +253,7 @@ namespace HZH_Controls.Controls ...@@ -253,7 +253,7 @@ namespace HZH_Controls.Controls
{ {
m_lstAnchors[menu] = new FrmAnchor(lbl, menu.ShowControl); m_lstAnchors[menu] = new FrmAnchor(lbl, menu.ShowControl);
} }
m_lstAnchors[menu].Show(); m_lstAnchors[menu].Show(this);
m_lstAnchors[menu].Size = menu.ShowControl.Size; m_lstAnchors[menu].Size = menu.ShowControl.Size;
} }
} }
......
namespace HZH_Controls.Controls
{
partial class UCNavigationMenuOffice
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panMenu = new System.Windows.Forms.Panel();
this.panChilds = new System.Windows.Forms.Panel();
this.SuspendLayout();
//
// panMenu
//
this.panMenu.Dock = System.Windows.Forms.DockStyle.Top;
this.panMenu.Location = new System.Drawing.Point(0, 0);
this.panMenu.MaximumSize = new System.Drawing.Size(0, 25);
this.panMenu.MinimumSize = new System.Drawing.Size(0, 25);
this.panMenu.Name = "panMenu";
this.panMenu.Size = new System.Drawing.Size(441, 25);
this.panMenu.TabIndex = 0;
//
// panChilds
//
this.panChilds.Dock = System.Windows.Forms.DockStyle.Fill;
this.panChilds.Location = new System.Drawing.Point(0, 25);
this.panChilds.Name = "panChilds";
this.panChilds.Size = new System.Drawing.Size(441, 100);
this.panChilds.TabIndex = 1;
//
// UCNavigationMenuOffice
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(57)))), ((int)(((byte)(61)))), ((int)(((byte)(73)))));
this.Controls.Add(this.panChilds);
this.Controls.Add(this.panMenu);
this.Font = new System.Drawing.Font("微软雅黑", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.Name = "UCNavigationMenuOffice";
this.Size = new System.Drawing.Size(441, 125);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panMenu;
private System.Windows.Forms.Panel panChilds;
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -97,6 +97,12 @@ ...@@ -97,6 +97,12 @@
<Compile Include="Controls\NavigationMenu\UCNavigationMenuExt.Designer.cs"> <Compile Include="Controls\NavigationMenu\UCNavigationMenuExt.Designer.cs">
<DependentUpon>UCNavigationMenuExt.cs</DependentUpon> <DependentUpon>UCNavigationMenuExt.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\NavigationMenu\UCNavigationMenuOffice.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\NavigationMenu\UCNavigationMenuOffice.Designer.cs">
<DependentUpon>UCNavigationMenuOffice.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Navigation\CrumbNavigationClickEventArgs.cs" /> <Compile Include="Controls\Navigation\CrumbNavigationClickEventArgs.cs" />
<Compile Include="Controls\Navigation\CrumbNavigationItem.cs" /> <Compile Include="Controls\Navigation\CrumbNavigationItem.cs" />
<Compile Include="Controls\Sampling\UCSampling.cs"> <Compile Include="Controls\Sampling\UCSampling.cs">
...@@ -732,6 +738,9 @@ ...@@ -732,6 +738,9 @@
<EmbeddedResource Include="Controls\NavigationMenu\UCNavigationMenuExt.resx"> <EmbeddedResource Include="Controls\NavigationMenu\UCNavigationMenuExt.resx">
<DependentUpon>UCNavigationMenuExt.cs</DependentUpon> <DependentUpon>UCNavigationMenuExt.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\NavigationMenu\UCNavigationMenuOffice.resx">
<DependentUpon>UCNavigationMenuOffice.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Navigation\UCCrumbNavigation.resx"> <EmbeddedResource Include="Controls\Navigation\UCCrumbNavigation.resx">
<DependentUpon>UCCrumbNavigation.cs</DependentUpon> <DependentUpon>UCCrumbNavigation.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -66,6 +66,7 @@ namespace Test ...@@ -66,6 +66,7 @@ namespace Test
tnControl.Nodes.Add("内置颜色"); tnControl.Nodes.Add("内置颜色");
tnControl.Nodes.Add("导航菜单"); tnControl.Nodes.Add("导航菜单");
tnControl.Nodes.Add("扩展导航菜单"); tnControl.Nodes.Add("扩展导航菜单");
tnControl.Nodes.Add("类Office导航菜单");
tnControl.Nodes.Add("分割线标签"); tnControl.Nodes.Add("分割线标签");
tnControl.Nodes.Add("时间轴"); tnControl.Nodes.Add("时间轴");
tnControl.Nodes.Add("穿梭框"); tnControl.Nodes.Add("穿梭框");
...@@ -274,6 +275,9 @@ namespace Test ...@@ -274,6 +275,9 @@ namespace Test
case "扩展导航菜单": case "扩展导航菜单":
AddControl(new UC.UCTestNavigationMenuExt()); AddControl(new UC.UCTestNavigationMenuExt());
break; break;
case "类Office导航菜单":
AddControl(new UC.UCTestNavigationMenuOffice());
break;
case "分割线标签": case "分割线标签":
AddControl(new UC.UCTestSplitLabel()); AddControl(new UC.UCTestSplitLabel());
break; break;
......
...@@ -224,6 +224,18 @@ ...@@ -224,6 +224,18 @@
<Compile Include="UC\UCTestNavigationMenuExt.Designer.cs"> <Compile Include="UC\UCTestNavigationMenuExt.Designer.cs">
<DependentUpon>UCTestNavigationMenuExt.cs</DependentUpon> <DependentUpon>UCTestNavigationMenuExt.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="UC\UCTestNavigationMenuOffice.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestNavigationMenuOffice.Designer.cs">
<DependentUpon>UCTestNavigationMenuOffice.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestNavigationMenuOfficeItem.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UC\UCTestNavigationMenuOfficeItem.Designer.cs">
<DependentUpon>UCTestNavigationMenuOfficeItem.cs</DependentUpon>
</Compile>
<Compile Include="UC\UCTestPage.cs"> <Compile Include="UC\UCTestPage.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
...@@ -464,6 +476,12 @@ ...@@ -464,6 +476,12 @@
<EmbeddedResource Include="UC\UCTestNavigationMenuExt.resx"> <EmbeddedResource Include="UC\UCTestNavigationMenuExt.resx">
<DependentUpon>UCTestNavigationMenuExt.cs</DependentUpon> <DependentUpon>UCTestNavigationMenuExt.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="UC\UCTestNavigationMenuOffice.resx">
<DependentUpon>UCTestNavigationMenuOffice.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestNavigationMenuOfficeItem.resx">
<DependentUpon>UCTestNavigationMenuOfficeItem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UC\UCTestPage.resx"> <EmbeddedResource Include="UC\UCTestPage.resx">
<DependentUpon>UCTestPage.cs</DependentUpon> <DependentUpon>UCTestPage.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HZH_Controls.Controls;
namespace Test.UC
{
public partial class UCTestNavigationMenuOffice : UserControl
{
public UCTestNavigationMenuOffice()
{
InitializeComponent();
}
private void UCTestNavigationMenuOffice_Load(object sender, EventArgs e)
{
foreach (NavigationMenuItemExt item in this.ucNavigationMenuOffice1.Items)
{
Control panel1 =new UCTestNavigationMenuOfficeItem( item.Text);
item.ShowControl = panel1;
}
this.ucNavigationMenuOffice1.ResetChildControl();
foreach (NavigationMenuItemExt item in this.ucNavigationMenuOffice2.Items)
{
Control panel1 = new UCTestNavigationMenuOfficeItem(item.Text);
item.ShowControl = panel1;
}
this.ucNavigationMenuOffice2.ResetChildControl();
foreach (NavigationMenuItemExt item in this.ucNavigationMenuOffice3.Items)
{
Control panel1 = new UCTestNavigationMenuOfficeItem(item.Text);
item.ShowControl = panel1;
}
this.ucNavigationMenuOffice3.ResetChildControl();
foreach (NavigationMenuItemExt item in this.ucNavigationMenuOffice4.Items)
{
Control panel1 = new UCTestNavigationMenuOfficeItem(item.Text);
item.ShowControl = panel1;
}
this.ucNavigationMenuOffice4.ResetChildControl();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="navigationMenuItemExt4.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAEGSURBVDhP7ZGxagJBFEX3A9JYBjtLgx9gIYRAsLKK/kSqFIKCyKbMD1jYpE8nyZJA2NmdnW0C
FpI/MKS3t8t58kxlsbOL3R64zHt35l12Z4Kakzjn2mmaXmhbHWPMo7X2B/XUqoYEivjKX0LnaheHoRHD
T9r+B6Im/it64xoudbsYSZIsGLQScgwUH2/I3jdreDjoA4N3DO6OgfRL+i31jR7xJ4qiBiGf6IureFa7
PAQN0UpE4FJtf/i9KwJeCBqjkPqedcLq8jxv6bFiMHjNoInjuKt9iB6k5nX71Gv2B9KXQgOnhPRYP9CG
+la3/ZFAeWVC9tQztcsjgeg9y7KOWjVnIwj+AISOvF76iy4mAAAAAElFTkSuQmCC
</value>
</data>
<data name="navigationMenuItemExt5.Icon" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAEGSURBVDhP7ZGxagJBFEX3A9JYBjtLgx9gIYRAsLKK/kSqFIKCyKbMD1jYpE8nyZJA2NmdnW0C
FpI/MKS3t8t58kxlsbOL3R64zHt35l12Z4Kakzjn2mmaXmhbHWPMo7X2B/XUqoYEivjKX0LnaheHoRHD
T9r+B6Im/it64xoudbsYSZIsGLQScgwUH2/I3jdreDjoA4N3DO6OgfRL+i31jR7xJ4qiBiGf6IureFa7
PAQN0UpE4FJtf/i9KwJeCBqjkPqedcLq8jxv6bFiMHjNoInjuKt9iB6k5nX71Gv2B9KXQgOnhPRYP9CG
+la3/ZFAeWVC9tQztcsjgeg9y7KOWjVnIwj+AISOvF76iy4mAAAAAElFTkSuQmCC
</value>
</data>
</root>
\ No newline at end of file \ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Test.UC
{
public partial class UCTestNavigationMenuOfficeItem : UserControl
{
public UCTestNavigationMenuOfficeItem(string str)
{
InitializeComponent();
label1.Text = str;
}
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!