预览
代码
手机端效果
web端效果
demoNodeView.cs
demoNodeView.Designer.cs
web:demoNodeView.cs
web:demoNodeView.Designer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace Smobiler.Tutorials.Controls
{
partial class demoNodeView : Smobiler.Core.Controls.MobileForm
{
public demoNodeView() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
private void button1_Press(object sender, EventArgs e)
{
popList1.ShowDialog();
}
private void demoNodeView_Load(object sender, EventArgs e)
{
PopListGroup pg1 = new PopListGroup();
pg1.AddListItem("添加节点");
pg1.AddListItem("NodeViewItemPress");
pg1.AddListItem("清除节点");
popList1.Groups.Add(pg1);
}
private void popList1_Selected(object sender, EventArgs e)
{
switch (popList1.Selection.Text)
{
case "添加节点":
addNodes();
button1.Text = "添加节点";
break;
case "清除节点":
nodeView1.Items.Clear();
button1.Text = "清除节点";
break;
case "NodeViewItemPress":
button1.Text = "点击节点触发事件";
break;
}
}
private void addNodes()
{
NodeViewItem nodeViewItem1 = new NodeViewItem() { Text="扫描员已经扫描",SubText=DateTime.Now.ToString(), IconColor = System.Drawing.Color.Gray, TextColor = System.Drawing.Color.DarkGray, SubTextColor = System.Drawing.Color.DarkGray };
NodeViewItem nodeViewItem2 = new NodeViewItem() { Text = "您的订单已完成挑拣", SubText = DateTime.Now.ToString(), IconColor = System.Drawing.Color.Gray, TextColor = System.Drawing.Color.DarkGray, SubTextColor = System.Drawing.Color.DarkGray };
NodeViewItem nodeViewItem3 = new NodeViewItem() { Text = "快递员已取货", SubText = DateTime.Now.ToString(), IconColor = System.Drawing.Color.Gray, TextColor = System.Drawing.Color.DarkGray,SubTextColor= System.Drawing.Color.DarkGray };
NodeViewItem nodeViewItem4 = new NodeViewItem() { Text = "您的订单正在派送中", SubText = DateTime.Now.ToString(),IconColor=System.Drawing.Color.DodgerBlue };
nodeView1.Items.AddRange(new NodeViewItem[] { nodeViewItem1, nodeViewItem2, nodeViewItem3, nodeViewItem4 });
}
private void nodeView1_NodeViewItemPress(object sender, NodeViewClickEventArgs e)
{
Toast("当前点击项Text:" + e.Item.Text);
}
}
}
using System;
using Smobiler.Core;
namespace Smobiler.Tutorials.Controls
{
partial class demoNodeView : Smobiler.Core.Controls.MobileForm
{
#region "SmobilerForm generated code "
//SmobilerForm overrides dispose to clean up the component list.
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
//NOTE: The following procedure is required by the SmobilerForm
//It can be modified using the SmobilerForm.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
this.title1 = new Smobiler.Core.Controls.Title();
this.panel1 = new Smobiler.Core.Controls.Panel();
this.panel2 = new Smobiler.Core.Controls.Panel();
this.labContent = new Smobiler.Core.Controls.Label();
this.labTitle = new Smobiler.Core.Controls.Label();
this.nodeView1 = new Smobiler.Core.Controls.NodeView();
this.button1 = new Smobiler.Core.Controls.Button();
this.popList1 = new Smobiler.Core.Controls.PopList();
//
// title1
//
this.title1.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.FontIcon;
this.title1.Name = "title1";
this.title1.ResourceID = "angle-left";
this.title1.Size = new System.Drawing.Size(300, 30);
this.title1.Text = "NodeView";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel1
//
this.panel1.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel2});
this.panel1.Flex = 1;
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(0, 100);
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Border = new Smobiler.Core.Controls.Border(1F);
this.panel2.BorderColor = System.Drawing.Color.Silver;
this.panel2.BorderRadius = 5;
this.panel2.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.labContent,
this.labTitle,
this.nodeView1,
this.button1});
this.panel2.Location = new System.Drawing.Point(5, 9);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(290, 453);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.WhiteSmoke;
this.labContent.FontSize = 15F;
this.labContent.Location = new System.Drawing.Point(0, 26);
this.labContent.Name = "labContent";
this.labContent.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labContent.Size = new System.Drawing.Size(290, 106);
this.labContent.Text = "FontIcon设置FontIcon图标\r\nFontSize设置控件字体大小\r\nForeColor设置控件字体颜色\r\nIconColor设置FontIcon颜色\r" +
"\nItemBackColor设置内容背景颜色\r\nItems设置节点";
this.labContent.VerticalAlignment = Smobiler.Core.Controls.VerticalAlignment.Top;
//
// labTitle
//
this.labTitle.BackColor = System.Drawing.Color.WhiteSmoke;
this.labTitle.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.labTitle.BorderColor = System.Drawing.Color.DarkSeaGreen;
this.labTitle.FontSize = 16F;
this.labTitle.Name = "labTitle";
this.labTitle.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labTitle.Size = new System.Drawing.Size(290, 26);
this.labTitle.Text = "节点显示控件";
//
// nodeView1
//
this.nodeView1.Location = new System.Drawing.Point(0, 202);
this.nodeView1.Name = "nodeView1";
this.nodeView1.Size = new System.Drawing.Size(300, 252);
this.nodeView1.NodeViewItemPress += new Smobiler.Core.Controls.NodeViewItemClickEventHandler(this.nodeView1_NodeViewItemPress);
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(192)))), ((int)(((byte)(78)))));
this.button1.Location = new System.Drawing.Point(37, 150);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(212, 30);
this.button1.Text = "控件介绍";
this.button1.Press += new System.EventHandler(this.button1_Press);
//
// popList1
//
this.popList1.Name = "popList1";
this.popList1.Selected += new System.EventHandler(this.popList1_Selected);
//
// demoNodeView
//
this.Components.AddRange(new Smobiler.Core.Controls.MobileComponent[] {
this.popList1});
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel1});
this.Layout = Smobiler.Core.Controls.LayoutPosition.Relative;
this.Load += new System.EventHandler(this.demoNodeView_Load);
this.Name = "demoNodeView";
}
#endregion
private Core.Controls.Title title1;
private Core.Controls.Panel panel1;
private Core.Controls.Panel panel2;
private Core.Controls.Label labTitle;
private Core.Controls.NodeView nodeView1;
private Core.Controls.Button button1;
private Core.Controls.PopList popList1;
private Core.Controls.Label labContent;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SmobilerTutorialsWeb.Components
{
partial class demoNodeView : Smobiler.Core.Controls.MobileForm
{
public demoNodeView() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
private void demoNodeView_Load(object sender, EventArgs e)
{
addNodes();
}
private void addNodes()
{
NodeViewItem nodeViewItem1 = new NodeViewItem() { Text = "扫描员已经扫描", SubText = DateTime.Now.ToString(), IconColor = System.Drawing.Color.Gray, TextColor = System.Drawing.Color.DarkGray, SubTextColor = System.Drawing.Color.DarkGray };
NodeViewItem nodeViewItem2 = new NodeViewItem() { Text = "您的订单已完成挑拣", SubText = DateTime.Now.ToString(), IconColor = System.Drawing.Color.Gray, TextColor = System.Drawing.Color.DarkGray, SubTextColor = System.Drawing.Color.DarkGray };
NodeViewItem nodeViewItem3 = new NodeViewItem() { Text = "快递员已取货", SubText = DateTime.Now.ToString(), IconColor = System.Drawing.Color.Gray, TextColor = System.Drawing.Color.DarkGray, SubTextColor = System.Drawing.Color.DarkGray };
NodeViewItem nodeViewItem4 = new NodeViewItem() { Text = "您的订单正在派送中", SubText = DateTime.Now.ToString(), IconColor = System.Drawing.Color.DodgerBlue };
nodeView1.Items.AddRange(new NodeViewItem[] { nodeViewItem1, nodeViewItem2, nodeViewItem3, nodeViewItem4 });
}
private void spinner1_ItemSelected(object sender, SpinnerItemSelectedEventArgs e)
{
switch (spinner1.Text)
{
case "添加节点":
addNodes();
labContent.Text = "添加节点";
break;
case "清除节点":
nodeView1.Items.Clear();
labContent.Text = "清除节点";
break;
case "NodeViewItemPress":
labContent.Text = "点击节点触发事件";
break;
}
}
private void nodeView1_NodeViewItemPress(object sender, NodeViewClickEventArgs e)
{
Toast("当前点击项Text:" + e.Item.Text);
}
}
}
using System;
using Smobiler.Core;
namespace SmobilerTutorialsWeb.Components
{
partial class demoComboBox : Smobiler.Core.Controls.MobileForm
{
#region "SmobilerForm generated code "
//SmobilerForm overrides dispose to clean up the component list.
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
//NOTE: The following procedure is required by the SmobilerForm
//It can be modified using the SmobilerForm.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
this.title1 = new Smobiler.Core.Controls.Title();
this.panel10 = new Smobiler.Core.Controls.Panel();
this.panel1 = new Smobiler.Core.Controls.Panel();
this.labContent = new Smobiler.Core.Controls.Label();
this.panel2 = new Smobiler.Core.Controls.Panel();
this.label5 = new Smobiler.Core.Controls.Label();
this.labTitle = new Smobiler.Core.Controls.Label();
this.label6 = new Smobiler.Core.Controls.Label();
this.comboBox1 = new Smobiler.Core.Controls.ComboBox();
this.comboBox2 = new Smobiler.Core.Controls.ComboBox();
this.comboBox3 = new Smobiler.Core.Controls.ComboBox();
//
// title1
//
this.title1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(246)))), ((int)(((byte)(246)))));
this.title1.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.FontIcon;
this.title1.Name = "title1";
this.title1.ResourceID = "angle-left";
this.title1.Size = new System.Drawing.Size(0, 30);
this.title1.Text = "Combobox";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1,
this.panel2,
this.labTitle,
this.label6});
this.panel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel10.Flex = 1;
this.panel10.Name = "panel10";
this.panel10.Scrollable = true;
this.panel10.Size = new System.Drawing.Size(0, 0);
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Border = new Smobiler.Core.Controls.Border(1F);
this.panel1.BorderColor = System.Drawing.Color.Silver;
this.panel1.BorderRadius = 5;
this.panel1.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.labContent,
this.comboBox1,
this.comboBox2});
this.panel1.Location = new System.Drawing.Point(134, 57);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(427, 179);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.White;
this.labContent.BorderColor = System.Drawing.Color.White;
this.labContent.Location = new System.Drawing.Point(0, 125);
this.labContent.Name = "labContent";
this.labContent.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labContent.Size = new System.Drawing.Size(426, 54);
this.labContent.Text = "下拉列表控件,基础控件,Text、FontSize、ForeColor属性设置不同样式;设置默认选择项只需设置Text属性,所赋的值必需时Items中项,否侧we" +
"b版中将不会显示 ";
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Border = new Smobiler.Core.Controls.Border(1F);
this.panel2.BorderColor = System.Drawing.Color.Silver;
this.panel2.BorderRadius = 5;
this.panel2.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.label5,
this.comboBox3});
this.panel2.Location = new System.Drawing.Point(659, 57);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(427, 179);
//
// label5
//
this.label5.BackColor = System.Drawing.Color.White;
this.label5.BorderColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(0, 125);
this.label5.Name = "label5";
this.label5.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label5.Size = new System.Drawing.Size(425, 54);
this.label5.Text = "ItemSelected在列表元素选择后发生";
//
// labTitle
//
this.labTitle.BackColor = System.Drawing.Color.White;
this.labTitle.Bold = true;
this.labTitle.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.labTitle.BorderColor = System.Drawing.Color.White;
this.labTitle.FontSize = 16F;
this.labTitle.Location = new System.Drawing.Point(134, 30);
this.labTitle.Name = "labTitle";
this.labTitle.Size = new System.Drawing.Size(290, 26);
this.labTitle.Text = "不同样式的下拉列表控件";
//
// label6
//
this.label6.BackColor = System.Drawing.Color.White;
this.label6.Bold = true;
this.label6.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.label6.BorderColor = System.Drawing.Color.White;
this.label6.FontSize = 16F;
this.label6.Location = new System.Drawing.Point(659, 30);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(290, 26);
this.label6.Text = "下拉列表控件事件";
//
// comboBox1
//
this.comboBox1.FontSize = 15F;
this.comboBox1.ForeColor = System.Drawing.Color.Gray;
this.comboBox1.ItemFontSize = 5F;
this.comboBox1.ItemForeColor = System.Drawing.Color.Gray;
this.comboBox1.Items.AddRange(new string[] {
"item1",
"item2",
"item3"});
this.comboBox1.Location = new System.Drawing.Point(61, 53);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(120, 30);
//
// comboBox2
//
this.comboBox2.Items.AddRange(new string[] {
"item1",
"item2",
"item3"});
this.comboBox2.Location = new System.Drawing.Point(208, 53);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(120, 30);
this.comboBox2.Text = "item2";
//
// comboBox3
//
this.comboBox3.Items.AddRange(new string[] {
"item1",
"item2",
"item3"});
this.comboBox3.Location = new System.Drawing.Point(146, 53);
this.comboBox3.Name = "comboBox3";
this.comboBox3.Size = new System.Drawing.Size(100, 30);
this.comboBox3.Text = "item3";
this.comboBox3.ItemSelected += new System.EventHandler(this.comboBox3_ItemSelected);
//
// demoComboBox
//
this.BackColor = System.Drawing.Color.White;
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel10});
this.Layout = Smobiler.Core.Controls.LayoutPosition.Relative;
this.Size = new System.Drawing.Size(1200, 800);
this.Name = "demoComboBox";
}
#endregion
private Smobiler.Core.Controls.Title title1;
private Smobiler.Core.Controls.Panel panel10;
private Smobiler.Core.Controls.Panel panel1;
private Smobiler.Core.Controls.Label labContent;
private Smobiler.Core.Controls.ComboBox comboBox1;
private Smobiler.Core.Controls.ComboBox comboBox2;
private Smobiler.Core.Controls.Panel panel2;
private Smobiler.Core.Controls.Label label5;
private Smobiler.Core.Controls.ComboBox comboBox3;
private Smobiler.Core.Controls.Label labTitle;
private Smobiler.Core.Controls.Label label6;
}
}