预览
代码
手机端效果
web端效果
demoPoplist.cs
demoPoplist.Designer.cs
web:demoPoplist.cs
web:demoPoplist.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 demoPopList : Smobiler.Core.Controls.MobileForm
{
public demoPopList()
: 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)
{
this.popList1.ShowDialog();
}
private void demoPopList_Load(object sender, EventArgs e)
{
PopListGroup g1 = new PopListGroup();
g1.AddListItem("Groups");
g1.AddListItem("Show");
g1.AddListItem("ShowDialog");
g1.AddListItem("Multi-Show");
g1.AddListItem("Multi-ShowDialog");
g1.AddListItem("SingleSelectMode");
g1.AddListItem("Selected事件");
popList1.Groups.Add(g1);
}
private void popList1_Selected(object sender, EventArgs e)
{
switch (popList1.Selections[0].Text)
{
case "Groups":
PopListGroup g1 = new PopListGroup();
g1.TitleVisible = true;
g1.Title = "审批人";
for (int i = 1; i < 3; i++)
{
g1.AddListItem(i.ToString());
}
PopListGroup g2 = new PopListGroup();
g2.Title = "抄送人";
g2.TitleVisible = true;
for (int i = 1; i < 3; i++)
{
g2.AddListItem(i.ToString());
}
PopListItem popItem = new PopListItem();
popItem.Value = "USER_ID";
popItem.Text = "USER_ID";
g2.Items.Add(popItem);
this.popList2.Groups.Add(g1);
this.popList2.Groups.Add(g2);
labContent.Text = "选择组集合数据添加";
break;
case "Show":
this.popList2.MultiSelect = false;
this.popList2.SingleSelectMode = true;
this.popList2.Show();
labContent.Text = "显示列表选择界面";
break;
case "ShowDialog":
this.popList2.MultiSelect = false;
this.popList2.ShowDialog();
labContent.Text = "显示对话框列表选择界面";
break;
case "Multi-Show":
this.popList2.MultiSelect = true;
this.popList2.Show();
labContent.Text = "设置多选来显示列表选择界面";
break;
case "Multi-ShowDialog":
this.popList2.MultiSelect = true;
this.popList2.ShowDialog();
labContent.Text = "设置多选来显示对话框列表选择界面";
break;
case "SingleSelectMode":
this.popList2.MultiSelect = false;
this.popList2.SingleSelectMode = false;
this.popList2.Show();
labContent.Text = "单选时可设置2种不同的选择模式,true时点击结束选择,false时点击完成按钮确认选择";
break;
case "Selected事件":
labContent.Text = "Selected事件在Poplist选择完成时发生。";
break;
}
}
}
}
using System;
using Smobiler.Core;
namespace Smobiler.Tutorials.Controls
{
partial class demoPopList : 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.labTitle = new Smobiler.Core.Controls.Label();
this.button1 = new Smobiler.Core.Controls.Button();
this.popList1 = new Smobiler.Core.Controls.PopList();
this.popList2 = 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 = "PopList";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1});
this.panel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel10.Location = new System.Drawing.Point(0, 30);
this.panel10.Name = "panel10";
this.panel10.Scrollable = true;
this.panel10.Size = new System.Drawing.Size(300, 970);
//
// 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.labTitle,
this.button1});
this.panel1.Location = new System.Drawing.Point(5, 9);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(290, 123);
//
// 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, 54);
this.labContent.Text = "组件,在设计器中不显示设计界面,可使用Show与ShowDialog显示界面";
//
// 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 = "列表选择组件";
//
// button1
//
this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
this.button1.Location = new System.Drawing.Point(39, 87);
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);
//
// popList2
//
this.popList2.Name = "popList2";
//
// demoPopList
//
this.Components.AddRange(new Smobiler.Core.Controls.MobileComponent[] {
this.popList1,
this.popList2});
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel10});
this.Load += new System.EventHandler(this.demoPopList_Load);
this.Name = "demoPopList";
}
#endregion
private Core.Controls.Title title1;
private Core.Controls.Panel panel10;
private Core.Controls.Panel panel1;
private Core.Controls.Label labContent;
private Core.Controls.Label labTitle;
private Core.Controls.Button button1;
private Core.Controls.PopList popList1;
private Core.Controls.PopList popList2;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SmobilerTutorialsWeb.Components
{
partial class demoPopList : Smobiler.Core.Controls.MobileForm
{
public demoPopList() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
private void demoPopList_Load(object sender, EventArgs e)
{
spinner1.Items = new string[]{ "Groups",
"Show",
"ShowDialog",
"Multi-Show",
"Multi-ShowDialog",
"SingleSelectMode",
"Selected事件" };
}
private void spinner1_ItemSelected(object sender, SpinnerItemSelectedEventArgs e)
{
switch (spinner1.Text)
{
case "Groups":
PopListGroup g1 = new PopListGroup();
g1.TitleVisible = true;
g1.Title = "审批人";
for (int i = 1; i < 3; i++)
{
g1.AddListItem(i.ToString());
}
PopListGroup g2 = new PopListGroup();
g2.Title = "抄送人";
g2.TitleVisible = true;
for (int i = 1; i < 3; i++)
{
g2.AddListItem(i.ToString());
}
PopListItem popItem = new PopListItem();
popItem.Value = "USER_ID";
popItem.Text = "USER_ID";
g2.Items.Add(popItem);
this.popList1.Groups.Add(g1);
this.popList1.Groups.Add(g2);
labContent.Text = "选择组集合数据添加";
break;
case "Show":
this.popList1.MultiSelect = false;
this.popList1.SingleSelectMode = true;
this.popList1.Show();
labContent.Text = "显示列表选择界面";
break;
case "ShowDialog":
this.popList1.MultiSelect = false;
this.popList1.ShowDialog();
labContent.Text = "显示对话框列表选择界面";
break;
case "Multi-Show":
this.popList1.MultiSelect = true;
this.popList1.Show();
labContent.Text = "设置多选来显示列表选择界面";
break;
case "Multi-ShowDialog":
this.popList1.MultiSelect = true;
this.popList1.ShowDialog();
labContent.Text = "设置多选来显示对话框列表选择界面";
break;
case "SingleSelectMode":
this.popList1.MultiSelect = false;
this.popList1.SingleSelectMode = false;
this.popList1.Show();
labContent.Text = "单选时可设置2种不同的选择模式,true时点击结束选择,false时点击完成按钮确认选择";
break;
case "Selected事件":
labContent.Text = "Selected事件在Poplist选择完成时发生。";
break;
}
}
private void popList1_Selected(object sender, EventArgs e)
{
Toast("当前 选择" + popList1.Selection.ToString());
}
}
}
using System;
using Smobiler.Core;
namespace SmobilerTutorialsWeb.Components
{
partial class demoPopList : 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.spinner1 = new Smobiler.Core.Controls.Spinner();
this.labTitle = new Smobiler.Core.Controls.Label();
this.popList1 = new Smobiler.Core.Controls.PopList();
//
// 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 = "PopList";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1,
this.labTitle});
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.spinner1});
this.panel1.Location = new System.Drawing.Point(300, 57);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(600, 187);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.White;
this.labContent.HorizontalAlignment = Smobiler.Core.Controls.HorizontalAlignment.Center;
this.labContent.Location = new System.Drawing.Point(0, 95);
this.labContent.Name = "labContent";
this.labContent.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labContent.Size = new System.Drawing.Size(600, 54);
this.labContent.Text = "组件,在设计器中不显示设计界面,可使用Show与ShowDialog显示界面";
//
// spinner1
//
this.spinner1.FontSize = 14F;
this.spinner1.Location = new System.Drawing.Point(175, 33);
this.spinner1.Name = "spinner1";
this.spinner1.Size = new System.Drawing.Size(224, 40);
this.spinner1.ItemSelected += new System.EventHandler<Smobiler.Core.Controls.SpinnerItemSelectedEventArgs>(this.spinner1_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(300, 30);
this.labTitle.Name = "labTitle";
this.labTitle.Size = new System.Drawing.Size(600, 26);
this.labTitle.Text = "列表选择组件";
//
// popList1
//
this.popList1.Name = "popList1";
this.popList1.Selected += new System.EventHandler(this.popList1_Selected);
//
// demoPopList
//
this.BackColor = System.Drawing.Color.White;
this.Components.AddRange(new Smobiler.Core.Controls.MobileComponent[] {
this.popList1});
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.Load += new System.EventHandler(this.demoPopList_Load);
this.Name = "demoPopList";
}
#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.Spinner spinner1;
private Smobiler.Core.Controls.Label labTitle;
private Smobiler.Core.Controls.PopList popList1;
}
}