预览
代码
手机端效果
web端效果
demoTabPageView.cs
demoTabPageView.Designer.cs
模板类demoTabPageViewTemplate.cs
模板类demoTabPageViewTemplate.Designer.cs
web:demoTabPageView.cs
web:demoTabPageView.Designer.cs
web:demoTabPageView.cs
web:demoTabPageView.Designer.cs
web:模板类demoTabPageViewTemplate.cs
web: 模板类demoTabPageViewTemplate.Designer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace Smobiler.Tutorials.Components
{
partial class demoTabPageView : Smobiler.Core.Controls.MobileForm
{
public demoTabPageView()
: 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 demoTabPageView_Load(object sender, EventArgs e)
{
PopListGroup g1 = new PopListGroup();
g1.AddListItem("Initial");
g1.AddListItem("ScrollEnabled");
g1.AddListItem("PageIndex");
g1.AddListItem("PageIndicator:Dot");
g1.AddListItem("PageIndicator: Title");
g1.AddListItem("TitleStyle");
g1.AddListItem("Titles");
g1.AddListItem("PageIndicator:None");
g1.AddListItem("Add");
g1.AddListItem("Remove");
g1.AddListItem("Clear");
popList1.Groups.Add(g1);
}
private void popList1_Selected(object sender, EventArgs e)
{
switch (popList1.Selections[0].Text)
{
case "Initial":
for (int i = 0; i < 2; i++)
{
this.tabPageView1.Controls.Add(new Smobiler.Tutorials.usercontrol.demoTabPageViewTemplate());
}
labContent.Text = "初始";
break;
case "ScrollEnabled":
this.tabPageView1.ScrollEnabled=false;
labContent.Text = "设置不允许滚动";
break;
case "PageIndex":
this.tabPageView1.PageIndex = 1;
labContent.Text = "切换Page页";
InitialTitle();
break;
case "PageIndicator:Dot":
this.tabPageView1.PageIndicator = TabPageIndicator.Dot;
labContent.Text = "设置点状显示标识";
break;
case "PageIndicator: Title":
this.tabPageView1.PageIndicator = TabPageIndicator.Title;
labContent.Text = "设置标题显示标识";
InitialTitle();
break;
case "TitleStyle":
this.tabPageView1.TitleStyle= new TabPageViewTitleStyle(System.Drawing.Color.AliceBlue, System.Drawing.Color.Red, System.Drawing.Color.Black, 20, System.Drawing.Color.Tomato, 5);
labContent.Text = "设置Title的样式";
break;
case "Titles":
this.tabPageView1.Titles = new string[] { "第一页","第二页"};
labContent.Text = "设置Title内容";
break;
case "PageIndicator:None":
this.tabPageView1.PageIndicator = TabPageIndicator.None;
labContent.Text = "设置无显示标识";
break;
case "Clear":
this.tabPageView1.Controls.Clear();
labContent.Text = "清空";
InitialTitle();
break;
case "Add":
this.tabPageView1.Controls.Add(new Smobiler.Tutorials.usercontrol.demoTabPageViewTemplate());
labContent.Text = "添加";
InitialTitle();
break;
case "Remove":
if (this.tabPageView1.Controls.Count > 0)
{
this.tabPageView1.Controls.RemoveAt(0);
InitialTitle();
}
labContent.Text = "删除";
break;
}
}
private void InitialTitle()
{
List<string> titleList = new List<string>();
for (int i = 0; i < this.tabPageView1.Controls.Count; i++)
{
titleList.Add(i.ToString());
}
this.tabPageView1.Titles = titleList.ToArray();
}
}
}
using System;
using Smobiler.Core;
namespace Smobiler.Tutorials.Components
{
partial class demoTabPageView : 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.tabPageView1 = new Smobiler.Core.Controls.TabPageView();
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 = "TabPageView";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1,
this.tabPageView1});
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 = "可进行数据添加,删除,清空\r\n";
//
// 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)(254)))), ((int)(((byte)(192)))), ((int)(((byte)(78)))));
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);
//
// tabPageView1
//
this.tabPageView1.Location = new System.Drawing.Point(0, 140);
this.tabPageView1.Name = "tabPageView1";
this.tabPageView1.Size = new System.Drawing.Size(300, 300);
//
// popList1
//
this.popList1.Name = "popList1";
this.popList1.Selected += new System.EventHandler(this.popList1_Selected);
//
// demoTabPageView
//
this.Components.AddRange(new Smobiler.Core.Controls.MobileComponent[] {
this.popList1});
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel10});
this.Load += new System.EventHandler(this.demoTabPageView_Load);
this.Name = "demoTabPageView";
}
#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.TabPageView tabPageView1;
private Core.Controls.PopList popList1;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace Smobiler.Tutorials.usercontrol
{
////ToolboxItem用于控制是否添加自定义控件到工具箱,true添加,false不添加
//[System.ComponentModel.ToolboxItem(true)]
partial class demoTabPageViewTemplate : Smobiler.Core.Controls.MobileUserControl
{
public demoTabPageViewTemplate() : base()
{
//This call is required by the SmobilerUserControl.
InitializeComponent();
}
}
}
using System;
using Smobiler.Core;
namespace Smobiler.Tutorials.usercontrol
{
partial class demoPageViewTemplate : Smobiler.Core.Controls.MobileUserControl
{
#region "SmobilerUserControl generated code "
//SmobilerUserControl 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 SmobilerUserControl
//It can be modified using the SmobilerUserControl.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
this.image1 = new Smobiler.Core.Controls.Image();
//
// image1
//
this.image1.DataMember = "image";
this.image1.DisplayMember = "image";
this.image1.Flex = 1;
this.image1.Name = "image1";
this.image1.Size = new System.Drawing.Size(0, 0);
//
// demoPageViewTemplate
//
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.image1});
this.Layout = Smobiler.Core.Controls.LayoutPosition.Relative;
this.Size = new System.Drawing.Size(300, 200);
this.Name = "demoPageViewTemplate";
}
#endregion
private Core.Controls.Image image1;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
using SmobilerTutorialsWeb.UserControls;
namespace SmobilerTutorialsWeb
{
partial class demoTabPageView : Smobiler.Core.Controls.MobileForm
{
public demoTabPageView() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
private void demoTabPageView_Load(object sender, EventArgs e)
{
spinner1.Items = new string[] { "Initial", "ScrollEnabled", "PageIndex", "PageIndicator:Dot", "PageIndicator: Title", "TitleStyle" , "Titles", "PageIndicator:None","Add","Remove","Clear"};
}
private void InitialTitle()
{
List<string> titleList = new List<string>();
for (int i = 0; i < this.tabPageView1.Controls.Count; i++)
{
titleList.Add(i.ToString());
}
this.tabPageView1.Titles = titleList.ToArray();
}
private void spinner1_ItemSelected(object sender, SpinnerItemSelectedEventArgs e)
{
switch (spinner1.Text)
{
case "Initial":
for (int i = 0; i < 2; i++)
{
this.tabPageView1.Controls.Add(new demoTabPageViewTemplate());
}
labContent.Text = "初始";
break;
case "ScrollEnabled":
this.tabPageView1.ScrollEnabled = false;
labContent.Text = "设置不允许滚动";
break;
case "PageIndex":
this.tabPageView1.PageIndex = 1;
labContent.Text = "切换Page页";
InitialTitle();
break;
case "PageIndicator:Dot":
this.tabPageView1.PageIndicator = TabPageIndicator.Dot;
labContent.Text = "设置点状显示标识";
break;
case "PageIndicator: Title":
this.tabPageView1.PageIndicator = TabPageIndicator.Title;
labContent.Text = "设置标题显示标识";
InitialTitle();
break;
case "TitleStyle":
this.tabPageView1.TitleStyle = new TabPageViewTitleStyle(System.Drawing.Color.AliceBlue, System.Drawing.Color.Red, System.Drawing.Color.Black, 20, System.Drawing.Color.Tomato, 5);
labContent.Text = "设置Title的样式";
break;
case "Titles":
this.tabPageView1.Titles = new string[] { "第一页", "第二页" };
labContent.Text = "设置Title内容";
break;
case "PageIndicator:None":
this.tabPageView1.PageIndicator = TabPageIndicator.None;
labContent.Text = "设置无显示标识";
break;
case "Clear":
this.tabPageView1.Controls.Clear();
labContent.Text = "清空";
InitialTitle();
break;
case "Add":
this.tabPageView1.Controls.Add(new demoTabPageViewTemplate());
labContent.Text = "添加";
InitialTitle();
break;
case "Remove":
if (this.tabPageView1.Controls.Count > 0)
{
this.tabPageView1.Controls.RemoveAt(0);
InitialTitle();
}
labContent.Text = "删除";
break;
}
}
}
}
using System;
using Smobiler.Core;
namespace SmobilerTutorialsWeb
{
partial class demoTabPageView : 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.tabPageView1 = new Smobiler.Core.Controls.TabPageView();
this.spinner1 = new Smobiler.Core.Controls.Spinner();
this.labTitle = new Smobiler.Core.Controls.Label();
//
// 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 = "demoTabPageView";
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.tabPageView1,
this.spinner1});
this.panel1.Location = new System.Drawing.Point(300, 57);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(600, 484);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.White;
this.labContent.HorizontalAlignment = Smobiler.Core.Controls.HorizontalAlignment.Center;
this.labContent.Location = new System.Drawing.Point(0, 89);
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 = "点击上方选项,可进行数据添加,删除,清空\r\n";
//
// tabPageView1
//
this.tabPageView1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))), ((int)(((byte)(102)))));
this.tabPageView1.Location = new System.Drawing.Point(157, 162);
this.tabPageView1.Name = "tabPageView1";
this.tabPageView1.Size = new System.Drawing.Size(300, 300);
//
// spinner1
//
this.spinner1.ItemFontSize = 14F;
this.spinner1.Location = new System.Drawing.Point(157, 30);
this.spinner1.Name = "spinner1";
this.spinner1.Size = new System.Drawing.Size(300, 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 = "分页显示控件";
//
// demoTabPageView
//
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.Load += new System.EventHandler(this.demoTabPageView_Load);
this.Name = "demoTabPageView";
}
#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.TabPageView tabPageView1;
private Smobiler.Core.Controls.Label labTitle;
private Smobiler.Core.Controls.Spinner spinner1;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SmobilerTutorialsWeb.UserControls
{
////ToolboxItem用于控制是否添加自定义控件到工具箱,true添加,false不添加
//[System.ComponentModel.ToolboxItem(true)]
partial class demoTabPageViewTemplate : Smobiler.Core.Controls.MobileUserControl
{
public demoTabPageViewTemplate() : base()
{
//This call is required by the SmobilerUserControl.
InitializeComponent();
}
}
}
using System;
using Smobiler.Core;
namespace SmobilerTutorialsWeb.UserControls
{
partial class demoTabPageViewTemplate : Smobiler.Core.Controls.MobileUserControl
{
#region "SmobilerUserControl generated code "
//SmobilerUserControl 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 SmobilerUserControl
//It can be modified using the SmobilerUserControl.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
this.label1 = new Smobiler.Core.Controls.Label();
this.textBox1 = new Smobiler.Core.Controls.TextBox();
this.button1 = new Smobiler.Core.Controls.Button();
//
// label1
//
this.label1.Location = new System.Drawing.Point(18, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(262, 91);
this.label1.Text = "TabPageViewk可在设计器中可视化设计页面,也可以通过可添加自定义控件,即可设计自定义控件后添加到TabPageView\r\n";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(18, 126);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(262, 45);
//
// button1
//
this.button1.Location = new System.Drawing.Point(46, 204);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(200, 30);
this.button1.Text = "按钮";
//
// demoTabPageViewTemplate
//
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.label1,
this.textBox1,
this.button1});
this.Size = new System.Drawing.Size(300, 300);
this.Name = "demoTabPageViewTemplate";
}
#endregion
private Smobiler.Core.Controls.Label label1;
private Smobiler.Core.Controls.TextBox textBox1;
private Smobiler.Core.Controls.Button button1;
}
}