Commit 017189bd HZH

增加导航控件

1 个父辈 36d6f140
......@@ -164,6 +164,8 @@ namespace HZH_Controls.Controls
get { return m_rowType; }
set
{
if (value == null)
return;
if (!typeof(IDataGridViewRow).IsAssignableFrom(value) || !value.IsSubclassOf(typeof(Control)))
throw new Exception("行控件没有实现IDataGridViewRow接口");
m_rowType = value;
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
public interface IMenuItem
{
event EventHandler SelectedItem;
MenuItemEntity DataSource { get; set; }
/// <summary>
/// 设置样式
/// </summary>
/// <param name="styles">key:属性名称,value:属性值</param>
void SetStyle(Dictionary<string, object> styles);
/// <summary>
/// 设置选中样式
/// </summary>
/// <param name="blnSelected">是否选中</param>
void SetSelectedStyle(bool blnSelected);
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HZH_Controls.Controls
{
[Serializable]
public class MenuItemEntity
{
/// <summary>
/// 键
/// </summary>
public string Key { get; set; }
/// <summary>
/// 文字
/// </summary>
public string Text { get; set; }
/// <summary>
/// 子节点
/// </summary>
public List<MenuItemEntity> Childrens { get; set; }
/// <summary>
/// 自定义数据源,一般用于扩展展示,比如定义节点图片等
/// </summary>
public object DataSource { get; set; }
}
}
namespace HZH_Controls.Controls
{
partial class UCMenu
{
/// <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.SuspendLayout();
//
// UCMenu
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoScroll = true;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(30)))), ((int)(((byte)(39)))));
this.Name = "UCMenu";
this.Size = new System.Drawing.Size(204, 468);
this.ResumeLayout(false);
}
#endregion
}
}
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 HZH_Controls.Controls
{
public partial class UCMenu : UserControl
{
/// <summary>
/// 选中项事件
/// </summary>
public event EventHandler SelectedItem;
private Type m_parentItemType = typeof(UCMenuParentItem);
/// <summary>
/// 父类节点类型
/// </summary>
public Type ParentItemType
{
get { return m_parentItemType; }
set
{
if (value == null)
return;
if (!typeof(IMenuItem).IsAssignableFrom(value) || !value.IsSubclassOf(typeof(Control)))
throw new Exception("节点控件没有实现IMenuItem接口");
m_parentItemType = value;
}
}
private Type m_childrenItemType = typeof(UCMenuChildrenItem);
/// <summary>
/// 子类节点类型
/// </summary>
public Type ChildrenItemType
{
get { return m_childrenItemType; }
set
{
if (value == null)
return;
if (!typeof(IMenuItem).IsAssignableFrom(value) || !value.IsSubclassOf(typeof(Control)))
throw new Exception("节点控件没有实现IMenuItem接口");
m_childrenItemType = value;
}
}
private Dictionary<string, object> m_parentItemStyles;
/// <summary>
/// 父类节点样式设置,key:属性名称,value:属性值
/// </summary>
public Dictionary<string, object> ParentItemStyles
{
get { return m_parentItemStyles; }
set { m_parentItemStyles = value; }
}
private Dictionary<string, object> m_childrenItemStyles;
/// <summary>
/// 子类节点样式设置,key:属性名称,value:属性值
/// </summary>
public Dictionary<string, object> ChildrenItemStyles
{
get { return m_childrenItemStyles; }
set { m_childrenItemStyles = value; }
}
private List<MenuItemEntity> m_dataSource;
/// <summary>
/// 数据源
/// </summary>
public List<MenuItemEntity> DataSource
{
get { return m_dataSource; }
set
{
m_dataSource = value;
ReloadItems();
}
}
private bool m_isShowFirstItem = true;
/// <summary>
/// 是否自动展开第一个节点
/// </summary>
public bool IsShowFirstItem
{
get { return m_isShowFirstItem; }
set { m_isShowFirstItem = value; }
}
private List<Control> m_lstParentItems = new List<Control>();
private IMenuItem m_selectParentItem = null;
private IMenuItem m_selectChildrenItem = null;
private Panel m_panChildren = null;
private void ReloadItems()
{
try
{
ControlHelper.FreezeControl(this, true);
this.Controls.Clear();
m_lstParentItems.Clear();
if (m_dataSource != null && m_dataSource.Count > 0)
{
foreach (var parent in m_dataSource)
{
IMenuItem parentItem = (IMenuItem)Activator.CreateInstance(m_parentItemType);
parentItem.DataSource = parent;
if (m_parentItemStyles != null)
parentItem.SetStyle(m_parentItemStyles);
parentItem.SelectedItem += parentItem_SelectedItem;
Control c = parentItem as Control;
c.Dock = DockStyle.Top;
this.Controls.Add(c);
this.Controls.SetChildIndex(c, 0);
m_lstParentItems.Add(c);
}
}
m_panChildren = new Panel();
m_panChildren.Dock = DockStyle.Fill;
m_panChildren.AutoScroll = true;
this.Controls.Add(m_panChildren);
this.Controls.SetChildIndex(m_panChildren, 0);
}
finally
{
ControlHelper.FreezeControl(this, false);
}
if (m_isShowFirstItem && m_lstParentItems != null && m_lstParentItems.Count > 0)
{
parentItem_SelectedItem(m_lstParentItems[0], null);
}
}
void parentItem_SelectedItem(object sender, EventArgs e)
{
IMenuItem item = sender as IMenuItem;
if (m_lstParentItems.Contains(sender as Control))
{
if (m_selectParentItem != item)
{
if (m_selectParentItem != null)
{
m_selectParentItem.SetSelectedStyle(false);
}
m_selectParentItem = item;
m_selectParentItem.SetSelectedStyle(true);
SetChildrenControl(m_selectParentItem);
}
else
{
m_selectParentItem.SetSelectedStyle(false);
m_selectParentItem = null;
SetChildrenControl(m_selectParentItem, false);
}
}
else if (m_panChildren.Controls.Contains(sender as Control))
{
if (m_selectChildrenItem != item)
{
if (m_selectChildrenItem != null)
{
m_selectChildrenItem.SetSelectedStyle(false);
}
m_selectChildrenItem = item;
m_selectChildrenItem.SetSelectedStyle(true);
}
}
if (SelectedItem != null)
{
SelectedItem(sender, e);
}
}
private void SetChildrenControl(IMenuItem menuitem, bool blnChildren = true)
{
try
{
ControlHelper.FreezeControl(this, true);
if (blnChildren)
{
Control cMenu = menuitem as Control;
int index = m_lstParentItems.IndexOf(cMenu);
for (int i = 0; i <= index; i++)
{
m_lstParentItems[i].Dock = DockStyle.Top;
this.Controls.SetChildIndex(m_lstParentItems[i], 1);
}
for (int i = index + 1; i < m_lstParentItems.Count; i++)
{
m_lstParentItems[i].Dock = DockStyle.Bottom;
this.Controls.SetChildIndex(m_lstParentItems[i], m_lstParentItems.Count);
}
m_panChildren.Controls.Clear();
int intItemHeigth = 0;
foreach (var item in menuitem.DataSource.Childrens)
{
IMenuItem parentItem = (IMenuItem)Activator.CreateInstance(m_childrenItemType);
parentItem.DataSource = item;
if (m_childrenItemStyles != null)
parentItem.SetStyle(m_childrenItemStyles);
parentItem.SelectedItem += parentItem_SelectedItem;
Control c = parentItem as Control;
if (intItemHeigth == 0)
intItemHeigth = c.Height;
c.Dock = DockStyle.Top;
m_panChildren.Controls.Add(c);
m_panChildren.Controls.SetChildIndex(c, 0);
}
m_panChildren.MinimumSize = new Size(0, menuitem.DataSource.Childrens.Count * intItemHeigth);
}
else
{
m_panChildren.Controls.Clear();
foreach (var item in m_lstParentItems)
{
item.Dock = DockStyle.Top;
this.Controls.SetChildIndex(item, 1);
}
}
}
finally
{
ControlHelper.FreezeControl(this, false);
}
}
public UCMenu()
{
InitializeComponent();
}
}
}
<?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
namespace HZH_Controls.Controls
{
partial class UCMenuChildrenItem
{
/// <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.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.lblTitle = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// ucSplitLine_H1
//
this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(29)))), ((int)(((byte)(43)))), ((int)(((byte)(54)))));
this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucSplitLine_H1.Location = new System.Drawing.Point(0, 59);
this.ucSplitLine_H1.Name = "ucSplitLine_H1";
this.ucSplitLine_H1.Size = new System.Drawing.Size(200, 1);
this.ucSplitLine_H1.TabIndex = 0;
this.ucSplitLine_H1.TabStop = false;
//
// lblTitle
//
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 12F);
this.lblTitle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(145)))), ((int)(((byte)(152)))), ((int)(((byte)(170)))));
this.lblTitle.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(200, 59);
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "子项";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// UCMenuChildrenItem
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(30)))), ((int)(((byte)(39)))));
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.ucSplitLine_H1);
this.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "UCMenuChildrenItem";
this.Size = new System.Drawing.Size(200, 60);
this.ResumeLayout(false);
}
#endregion
private UCSplitLine_H ucSplitLine_H1;
private System.Windows.Forms.Label lblTitle;
}
}
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 HZH_Controls.Controls
{
/// <summary>
/// 子类节点
/// </summary>
[ToolboxItem(false)]
public partial class UCMenuChildrenItem : UserControl, IMenuItem
{
public event EventHandler SelectedItem;
private MenuItemEntity m_dataSource;
public MenuItemEntity DataSource
{
get
{
return m_dataSource;
}
set
{
m_dataSource = value;
if (value != null)
{
lblTitle.Text = value.Text;
}
}
}
public UCMenuChildrenItem()
{
InitializeComponent();
this.lblTitle.MouseDown += lblTitle_MouseDown;
}
void lblTitle_MouseDown(object sender, MouseEventArgs e)
{
if (SelectedItem != null)
{
SelectedItem(this, null);
}
}
public void SetStyle(Dictionary<string, object> styles)
{
Type t = this.GetType();
foreach (var item in styles)
{
var pro = t.GetProperty(item.Key);
if (pro != null && pro.CanWrite)
{
try
{
pro.SetValue(this, item.Value, null);
}
catch (Exception ex)
{
throw new Exception("菜单元素设置样式异常", ex);
}
}
}
}
public void SetSelectedStyle(bool blnSelected)
{
}
}
}
<?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
namespace HZH_Controls.Controls
{
partial class UCMenuParentItem
{
/// <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.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
this.lblTitle = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// ucSplitLine_H1
//
this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(30)))), ((int)(((byte)(39)))));
this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.ucSplitLine_H1.Location = new System.Drawing.Point(0, 59);
this.ucSplitLine_H1.Name = "ucSplitLine_H1";
this.ucSplitLine_H1.Size = new System.Drawing.Size(200, 1);
this.ucSplitLine_H1.TabIndex = 0;
this.ucSplitLine_H1.TabStop = false;
//
// lblTitle
//
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblTitle.ForeColor = System.Drawing.Color.White;
this.lblTitle.Image = global::HZH_Controls.Properties.Resources.sanjiao2;
this.lblTitle.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblTitle.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(200, 59);
this.lblTitle.TabIndex = 1;
this.lblTitle.Text = "父项";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// UCMenuParentItem
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(29)))), ((int)(((byte)(43)))), ((int)(((byte)(54)))));
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.ucSplitLine_H1);
this.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "UCMenuParentItem";
this.Size = new System.Drawing.Size(200, 60);
this.ResumeLayout(false);
}
#endregion
private UCSplitLine_H ucSplitLine_H1;
private System.Windows.Forms.Label lblTitle;
}
}
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 HZH_Controls.Controls
{
/// <summary>
/// 父类节点
/// </summary>
[ToolboxItem(false)]
public partial class UCMenuParentItem : UserControl, IMenuItem
{
public event EventHandler SelectedItem;
private MenuItemEntity m_dataSource;
public MenuItemEntity DataSource
{
get
{
return m_dataSource;
}
set
{
m_dataSource = value;
if (value != null)
{
lblTitle.Text = value.Text;
}
}
}
public UCMenuParentItem()
{
InitializeComponent();
lblTitle.MouseDown += lblTitle_MouseDown;
}
public void SetStyle(Dictionary<string, object> styles)
{
Type t = this.GetType();
foreach (var item in styles)
{
var pro = t.GetProperty(item.Key);
if (pro != null && pro.CanWrite)
{
try
{
pro.SetValue(this, item.Value, null);
}
catch (Exception ex)
{
throw new Exception("菜单元素设置样式异常", ex);
}
}
}
}
public void SetSelectedStyle(bool blnSelected)
{
if (blnSelected)
{
this.lblTitle.Image = Properties.Resources.sanjiao1;
}
else
{
this.lblTitle.Image = Properties.Resources.sanjiao2;
}
}
void lblTitle_MouseDown(object sender, MouseEventArgs e)
{
if (SelectedItem != null)
{
SelectedItem(this, e);
}
}
}
}
<?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
......@@ -66,6 +66,26 @@
<Compile Include="Controls\List\UCPagerControl.Designer.cs">
<DependentUpon>UCPagerControl.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Menu\IMenuItem.cs" />
<Compile Include="Controls\Menu\MenuItemEntity.cs" />
<Compile Include="Controls\Menu\UCMenu.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Menu\UCMenu.Designer.cs">
<DependentUpon>UCMenu.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Menu\UCMenuChildrenItem.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Menu\UCMenuChildrenItem.Designer.cs">
<DependentUpon>UCMenuChildrenItem.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Menu\UCMenuParentItem.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Menu\UCMenuParentItem.Designer.cs">
<DependentUpon>UCMenuParentItem.cs</DependentUpon>
</Compile>
<Compile Include="Helpers\ControlHelper.cs" />
<Compile Include="Controls\Btn\UCBtnExt.cs">
<SubType>UserControl</SubType>
......@@ -352,6 +372,15 @@
<EmbeddedResource Include="Controls\List\UCPagerControlBase.resx">
<DependentUpon>UCPagerControlBase.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Menu\UCMenu.resx">
<DependentUpon>UCMenu.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Menu\UCMenuChildrenItem.resx">
<DependentUpon>UCMenuChildrenItem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Menu\UCMenuParentItem.resx">
<DependentUpon>UCMenuParentItem.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Process\ProcessExt.resx">
<DependentUpon>ProcessExt.cs</DependentUpon>
</EmbeddedResource>
......@@ -522,6 +551,12 @@
<ItemGroup>
<None Include="Resources\first.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\sanjiao2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\sanjiao1.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>md "$(TargetDir)HandInput"
......
......@@ -383,6 +383,26 @@ namespace HZH_Controls.Properties {
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap sanjiao1 {
get {
object obj = ResourceManager.GetObject("sanjiao1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap sanjiao2 {
get {
object obj = ResourceManager.GetObject("sanjiao2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap success {
get {
object obj = ResourceManager.GetObject("success", resourceCulture);
......
......@@ -223,4 +223,10 @@
<data name="right" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sanjiao1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sanjiao1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sanjiao2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sanjiao2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
......@@ -41,28 +41,26 @@
this.button8 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.button9 = new System.Windows.Forms.Button();
this.ucHorizontalList1 = new HZH_Controls.Controls.UCHorizontalList();
this.groupBox7 = new System.Windows.Forms.GroupBox();
this.ucDatePickerExt3 = new HZH_Controls.Controls.UCDatePickerExt();
this.ucDatePickerExt2 = new HZH_Controls.Controls.UCDatePickerExt();
this.ucDatePickerExt1 = new HZH_Controls.Controls.UCDatePickerExt();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.ucComboBox2 = new HZH_Controls.Controls.UCComboBox();
this.ucComboBox1 = new HZH_Controls.Controls.UCComboBox();
this.groupBox8 = new System.Windows.Forms.GroupBox();
this.ucListExt1 = new HZH_Controls.Controls.UCListExt();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.treeViewEx1 = new HZH_Controls.Controls.TreeViewEx();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.ucTextBoxEx4 = new HZH_Controls.Controls.UCTextBoxEx();
this.ucTextBoxEx3 = new HZH_Controls.Controls.UCTextBoxEx();
this.ucTextBoxEx2 = new HZH_Controls.Controls.UCTextBoxEx();
this.ucTextBoxEx1 = new HZH_Controls.Controls.UCTextBoxEx();
this.ucNumTextBox1 = new HZH_Controls.Controls.UCNumTextBox();
this.textBoxTransparent1 = new HZH_Controls.Controls.TextBoxTransparent();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.ucCheckBox4 = new HZH_Controls.Controls.UCCheckBox();
this.ucCheckBox3 = new HZH_Controls.Controls.UCCheckBox();
this.ucCheckBox2 = new HZH_Controls.Controls.UCCheckBox();
......@@ -71,11 +69,15 @@
this.ucRadioButton3 = new HZH_Controls.Controls.UCRadioButton();
this.ucRadioButton2 = new HZH_Controls.Controls.UCRadioButton();
this.ucRadioButton1 = new HZH_Controls.Controls.UCRadioButton();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.ucBtnImg1 = new HZH_Controls.Controls.UCBtnImg();
this.ucBtnFillet1 = new HZH_Controls.Controls.UCBtnFillet();
this.ucBtnExt2 = new HZH_Controls.Controls.UCBtnExt();
this.ucBtnExt1 = new HZH_Controls.Controls.UCBtnExt();
this.button9 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.groupBox10 = new System.Windows.Forms.GroupBox();
this.ucMenu1 = new HZH_Controls.Controls.UCMenu();
this.groupBox1.SuspendLayout();
this.groupBox9.SuspendLayout();
this.groupBox7.SuspendLayout();
......@@ -85,6 +87,7 @@
this.groupBox4.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox10.SuspendLayout();
this.SuspendLayout();
//
// timer1
......@@ -199,6 +202,16 @@
this.groupBox9.TabStop = false;
this.groupBox9.Text = "横向列表";
//
// ucHorizontalList1
//
this.ucHorizontalList1.DataSource = null;
this.ucHorizontalList1.IsAutoSelectFirst = true;
this.ucHorizontalList1.Location = new System.Drawing.Point(6, 25);
this.ucHorizontalList1.Name = "ucHorizontalList1";
this.ucHorizontalList1.SelectedItem = null;
this.ucHorizontalList1.Size = new System.Drawing.Size(473, 53);
this.ucHorizontalList1.TabIndex = 0;
//
// groupBox7
//
this.groupBox7.Controls.Add(this.ucDatePickerExt3);
......@@ -211,102 +224,6 @@
this.groupBox7.TabStop = false;
this.groupBox7.Text = "日历";
//
// groupBox6
//
this.groupBox6.Controls.Add(this.ucComboBox2);
this.groupBox6.Controls.Add(this.ucComboBox1);
this.groupBox6.Location = new System.Drawing.Point(25, 363);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(187, 119);
this.groupBox6.TabIndex = 6;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "下拉列表";
//
// groupBox8
//
this.groupBox8.Controls.Add(this.ucListExt1);
this.groupBox8.Location = new System.Drawing.Point(876, 30);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(240, 324);
this.groupBox8.TabIndex = 4;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "列表";
//
// groupBox5
//
this.groupBox5.Controls.Add(this.treeViewEx1);
this.groupBox5.Location = new System.Drawing.Point(625, 30);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(240, 327);
this.groupBox5.TabIndex = 4;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "树";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.ucTextBoxEx4);
this.groupBox4.Controls.Add(this.ucTextBoxEx3);
this.groupBox4.Controls.Add(this.ucTextBoxEx2);
this.groupBox4.Controls.Add(this.ucTextBoxEx1);
this.groupBox4.Controls.Add(this.ucNumTextBox1);
this.groupBox4.Controls.Add(this.textBoxTransparent1);
this.groupBox4.Location = new System.Drawing.Point(397, 30);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(209, 327);
this.groupBox4.TabIndex = 2;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "文本框";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.ucCheckBox4);
this.groupBox3.Controls.Add(this.ucCheckBox3);
this.groupBox3.Controls.Add(this.ucCheckBox2);
this.groupBox3.Controls.Add(this.ucCheckBox1);
this.groupBox3.Controls.Add(this.ucRadioButton4);
this.groupBox3.Controls.Add(this.ucRadioButton3);
this.groupBox3.Controls.Add(this.ucRadioButton2);
this.groupBox3.Controls.Add(this.ucRadioButton1);
this.groupBox3.Location = new System.Drawing.Point(232, 30);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(149, 327);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "单选/复选";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.ucBtnImg1);
this.groupBox2.Controls.Add(this.ucBtnFillet1);
this.groupBox2.Controls.Add(this.ucBtnExt2);
this.groupBox2.Controls.Add(this.ucBtnExt1);
this.groupBox2.Location = new System.Drawing.Point(25, 30);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(187, 327);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "按钮";
//
// button9
//
this.button9.Location = new System.Drawing.Point(964, 34);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(116, 23);
this.button9.TabIndex = 0;
this.button9.Text = "FrmAnchor2";
this.button9.UseVisualStyleBackColor = true;
this.button9.Click += new System.EventHandler(this.button9_Click);
//
// ucHorizontalList1
//
this.ucHorizontalList1.DataSource = null;
this.ucHorizontalList1.IsAutoSelectFirst = true;
this.ucHorizontalList1.Location = new System.Drawing.Point(6, 25);
this.ucHorizontalList1.Name = "ucHorizontalList1";
this.ucHorizontalList1.SelectedItem = null;
this.ucHorizontalList1.Size = new System.Drawing.Size(473, 53);
this.ucHorizontalList1.TabIndex = 0;
//
// ucDatePickerExt3
//
this.ucDatePickerExt3.BackColor = System.Drawing.Color.Transparent;
......@@ -367,6 +284,17 @@
this.ucDatePickerExt1.TimeFontSize = 20;
this.ucDatePickerExt1.TimeType = HZH_Controls.Controls.DateTimePickerType.DateTime;
//
// groupBox6
//
this.groupBox6.Controls.Add(this.ucComboBox2);
this.groupBox6.Controls.Add(this.ucComboBox1);
this.groupBox6.Location = new System.Drawing.Point(25, 363);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(187, 119);
this.groupBox6.TabIndex = 6;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "下拉列表";
//
// ucComboBox2
//
this.ucComboBox2.BackColor = System.Drawing.Color.Transparent;
......@@ -415,6 +343,16 @@
this.ucComboBox1.TabIndex = 5;
this.ucComboBox1.TextValue = null;
//
// groupBox8
//
this.groupBox8.Controls.Add(this.ucListExt1);
this.groupBox8.Location = new System.Drawing.Point(876, 30);
this.groupBox8.Name = "groupBox8";
this.groupBox8.Size = new System.Drawing.Size(240, 324);
this.groupBox8.TabIndex = 4;
this.groupBox8.TabStop = false;
this.groupBox8.Text = "列表";
//
// ucListExt1
//
this.ucListExt1.AutoScroll = true;
......@@ -435,6 +373,16 @@
this.ucListExt1.Title2Font = new System.Drawing.Font("微软雅黑", 14F);
this.ucListExt1.TitleFont = new System.Drawing.Font("微软雅黑", 15F);
//
// groupBox5
//
this.groupBox5.Controls.Add(this.treeViewEx1);
this.groupBox5.Location = new System.Drawing.Point(625, 30);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(240, 327);
this.groupBox5.TabIndex = 4;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "树";
//
// treeViewEx1
//
this.treeViewEx1.BackColor = System.Drawing.Color.White;
......@@ -467,6 +415,21 @@
this.treeViewEx1.TipFont = new System.Drawing.Font("Arial Unicode MS", 12F);
this.treeViewEx1.TipImage = ((System.Drawing.Image)(resources.GetObject("treeViewEx1.TipImage")));
//
// groupBox4
//
this.groupBox4.Controls.Add(this.ucTextBoxEx4);
this.groupBox4.Controls.Add(this.ucTextBoxEx3);
this.groupBox4.Controls.Add(this.ucTextBoxEx2);
this.groupBox4.Controls.Add(this.ucTextBoxEx1);
this.groupBox4.Controls.Add(this.ucNumTextBox1);
this.groupBox4.Controls.Add(this.textBoxTransparent1);
this.groupBox4.Location = new System.Drawing.Point(397, 30);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(209, 327);
this.groupBox4.TabIndex = 2;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "文本框";
//
// ucTextBoxEx4
//
this.ucTextBoxEx4.BackColor = System.Drawing.Color.Transparent;
......@@ -683,6 +646,23 @@
this.textBoxTransparent1.TabIndex = 0;
this.textBoxTransparent1.Text = "这是一个透明文本框";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.ucCheckBox4);
this.groupBox3.Controls.Add(this.ucCheckBox3);
this.groupBox3.Controls.Add(this.ucCheckBox2);
this.groupBox3.Controls.Add(this.ucCheckBox1);
this.groupBox3.Controls.Add(this.ucRadioButton4);
this.groupBox3.Controls.Add(this.ucRadioButton3);
this.groupBox3.Controls.Add(this.ucRadioButton2);
this.groupBox3.Controls.Add(this.ucRadioButton1);
this.groupBox3.Location = new System.Drawing.Point(232, 30);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(149, 327);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "单选/复选";
//
// ucCheckBox4
//
this.ucCheckBox4.BackColor = System.Drawing.Color.Transparent;
......@@ -767,6 +747,19 @@
this.ucRadioButton1.TabIndex = 0;
this.ucRadioButton1.TextValue = "单选按钮1";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.ucBtnImg1);
this.groupBox2.Controls.Add(this.ucBtnFillet1);
this.groupBox2.Controls.Add(this.ucBtnExt2);
this.groupBox2.Controls.Add(this.ucBtnExt1);
this.groupBox2.Location = new System.Drawing.Point(25, 30);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(187, 327);
this.groupBox2.TabIndex = 0;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "按钮";
//
// ucBtnImg1
//
this.ucBtnImg1.BackColor = System.Drawing.Color.White;
......@@ -859,6 +852,16 @@
this.ucBtnExt1.TabStop = false;
this.ucBtnExt1.TipsText = "";
//
// button9
//
this.button9.Location = new System.Drawing.Point(964, 34);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(116, 23);
this.button9.TabIndex = 0;
this.button9.Text = "FrmAnchor2";
this.button9.UseVisualStyleBackColor = true;
this.button9.Click += new System.EventHandler(this.button9_Click);
//
// comboBox1
//
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
......@@ -876,11 +879,36 @@
this.comboBox1.Size = new System.Drawing.Size(121, 20);
this.comboBox1.TabIndex = 2;
//
// groupBox10
//
this.groupBox10.Controls.Add(this.ucMenu1);
this.groupBox10.Location = new System.Drawing.Point(1162, 88);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(200, 490);
this.groupBox10.TabIndex = 3;
this.groupBox10.TabStop = false;
this.groupBox10.Text = "导航";
//
// ucMenu1
//
this.ucMenu1.ChildrenItemStyles = null;
this.ucMenu1.ChildrenItemType = typeof(HZH_Controls.Controls.UCMenuChildrenItem);
this.ucMenu1.DataSource = null;
this.ucMenu1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucMenu1.IsShowFirstItem = true;
this.ucMenu1.Location = new System.Drawing.Point(3, 17);
this.ucMenu1.Name = "ucMenu1";
this.ucMenu1.ParentItemStyles = null;
this.ucMenu1.ParentItemType = typeof(HZH_Controls.Controls.UCMenuParentItem);
this.ucMenu1.Size = new System.Drawing.Size(194, 470);
this.ucMenu1.TabIndex = 0;
//
// Form1
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1176, 616);
this.ClientSize = new System.Drawing.Size(1374, 616);
this.Controls.Add(this.groupBox10);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.button5);
......@@ -905,6 +933,7 @@
this.groupBox4.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox10.ResumeLayout(false);
this.ResumeLayout(false);
}
......@@ -957,6 +986,8 @@
private HZH_Controls.Controls.UCHorizontalList ucHorizontalList1;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.GroupBox groupBox10;
private HZH_Controls.Controls.UCMenu ucMenu1;
}
}
......@@ -64,6 +64,30 @@ namespace Test
}
this.ucHorizontalList1.DataSource = lstHL;
List<MenuItemEntity> lstMenu = new List<MenuItemEntity>();
for (int i = 0; i < 5; i++)
{
MenuItemEntity item = new MenuItemEntity()
{
Key = "p" + i.ToString(),
Text = "菜单项" + i,
DataSource = "这里编写一些自定义的数据源,用于扩展"
};
item.Childrens = new List<MenuItemEntity>();
for (int j = 0; j < 5; j++)
{
MenuItemEntity item2 = new MenuItemEntity()
{
Key = "c" + i.ToString(),
Text = "菜单子项" + i + "-" + j,
DataSource = "这里编写一些自定义的数据源,用于扩展"
};
item.Childrens.Add(item2);
}
lstMenu.Add(item);
}
this.ucMenu1.DataSource = lstMenu;
}
private void timer1_Tick(object sender, EventArgs e)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!