预览
代码
手机端效果
web端效果
demoRatingBar.cs
demoRatingBar.Designer.cs
web:demoRatingBar.cs
web:demoRatingBar.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 demoRatingBar : Smobiler.Core.Controls.MobileForm
{
public demoRatingBar()
: base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
}
}
using System;
using Smobiler.Core;
namespace Smobiler.Tutorials.Controls
{
partial class demoRatingBar : 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.label1 = new Smobiler.Core.Controls.Label();
this.label2 = new Smobiler.Core.Controls.Label();
this.label3 = new Smobiler.Core.Controls.Label();
this.label4 = new Smobiler.Core.Controls.Label();
this.ratingBar1 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar2 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar3 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar4 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar5 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar6 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar7 = new Smobiler.Core.Controls.RatingBar();
//
// 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 = "RatingBar";
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.label1,
this.label2,
this.label3,
this.label4,
this.ratingBar1,
this.ratingBar2,
this.ratingBar3,
this.ratingBar4,
this.ratingBar5,
this.ratingBar6,
this.ratingBar7});
this.panel1.Location = new System.Drawing.Point(5, 9);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(290, 533);
//
// 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 = "评价控件,不同样式的评价控件";
//
// 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 = "RatingBar控件";
//
// label1
//
this.label1.FontSize = 15F;
this.label1.Location = new System.Drawing.Point(0, 86);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(290, 35);
this.label1.Text = "NumRating属性可设置评价数量:\r\n";
//
// label2
//
this.label2.Location = new System.Drawing.Point(0, 198);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(290, 47);
this.label2.Text = "ResourceID与SelectedResourceID、ResourceColor与SelectedResourceColor属性可设置未选中与选择状态的图像" +
"资源与颜色:\r\n";
//
// label3
//
this.label3.FontSize = 15F;
this.label3.Location = new System.Drawing.Point(0, 328);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(290, 35);
this.label3.Text = "ImageType属性可设置图像类型:\r\n";
//
// label4
//
this.label4.FontSize = 15F;
this.label4.Location = new System.Drawing.Point(0, 410);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(290, 35);
this.label4.Text = "Value属性可设置当前评分值:";
//
// ratingBar1
//
this.ratingBar1.Location = new System.Drawing.Point(0, 121);
this.ratingBar1.Name = "ratingBar1";
this.ratingBar1.Size = new System.Drawing.Size(202, 35);
//
// ratingBar2
//
this.ratingBar2.Location = new System.Drawing.Point(0, 156);
this.ratingBar2.Name = "ratingBar2";
this.ratingBar2.NumRatings = 3;
this.ratingBar2.Size = new System.Drawing.Size(202, 35);
//
// ratingBar3
//
this.ratingBar3.Location = new System.Drawing.Point(0, 245);
this.ratingBar3.Name = "ratingBar3";
this.ratingBar3.ResourceID = "thumbs-o-up";
this.ratingBar3.SelectedResourceID = "thumbs-up";
this.ratingBar3.Size = new System.Drawing.Size(202, 35);
//
// ratingBar4
//
this.ratingBar4.Location = new System.Drawing.Point(0, 280);
this.ratingBar4.Name = "ratingBar4";
this.ratingBar4.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.ratingBar4.ResourceID = "thumbs-o-up";
this.ratingBar4.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(229)))), ((int)(((byte)(99)))));
this.ratingBar4.SelectedResourceID = "thumbs-up";
this.ratingBar4.Size = new System.Drawing.Size(202, 35);
//
// ratingBar5
//
this.ratingBar5.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.Image;
this.ratingBar5.Location = new System.Drawing.Point(0, 363);
this.ratingBar5.Name = "ratingBar5";
this.ratingBar5.ResourceID = "logon";
this.ratingBar5.SelectedResourceID = "logon";
this.ratingBar5.Size = new System.Drawing.Size(202, 35);
//
// ratingBar6
//
this.ratingBar6.Location = new System.Drawing.Point(0, 445);
this.ratingBar6.Name = "ratingBar6";
this.ratingBar6.ResourceColor = System.Drawing.Color.Silver;
this.ratingBar6.ResourceID = "thumbs-o-up";
this.ratingBar6.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(192)))), ((int)(((byte)(78)))));
this.ratingBar6.SelectedResourceID = "thumbs-up";
this.ratingBar6.Size = new System.Drawing.Size(202, 35);
this.ratingBar6.Value = 2;
//
// ratingBar7
//
this.ratingBar7.Location = new System.Drawing.Point(0, 480);
this.ratingBar7.Name = "ratingBar7";
this.ratingBar7.ResourceID = "thumbs-o-up";
this.ratingBar7.SelectedResourceID = "thumbs-up";
this.ratingBar7.Size = new System.Drawing.Size(202, 35);
this.ratingBar7.Value = 5;
//
// demoRatingBar
//
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel10});
this.Size = new System.Drawing.Size(300, 1000);
this.Name = "demoRatingBar";
}
#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.Label label1;
private Core.Controls.Label label2;
private Core.Controls.Label label3;
private Core.Controls.Label label4;
private Core.Controls.RatingBar ratingBar1;
private Core.Controls.RatingBar ratingBar2;
private Core.Controls.RatingBar ratingBar3;
private Core.Controls.RatingBar ratingBar4;
private Core.Controls.RatingBar ratingBar5;
private Core.Controls.RatingBar ratingBar6;
private Core.Controls.RatingBar ratingBar7;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SmobilerTutorialsWeb.Components
{
partial class demoRatingBar : Smobiler.Core.Controls.MobileForm
{
public demoRatingBar() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
private void demoRatingBar_Load(object sender, EventArgs e)
{
}
private void ratingBar6_ValueChanged(object sender, EventArgs e)
{
RatingBar rb = (RatingBar)sender;
Toast("当前值:"+rb.Value.ToString());
}
}
}
using System;
using Smobiler.Core;
namespace SmobilerTutorialsWeb.Components
{
partial class demoRatingBar : 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.label2 = new Smobiler.Core.Controls.Label();
this.label4 = new Smobiler.Core.Controls.Label();
this.ratingBar3 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar4 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar5 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar6 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar7 = new Smobiler.Core.Controls.RatingBar();
this.labTitle = new Smobiler.Core.Controls.Label();
this.label1 = new Smobiler.Core.Controls.Label();
this.ratingBar1 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar2 = new Smobiler.Core.Controls.RatingBar();
this.ratingBar9 = new Smobiler.Core.Controls.RatingBar();
this.label3 = new Smobiler.Core.Controls.Label();
this.ratingBar10 = new Smobiler.Core.Controls.RatingBar();
//
// 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 = "RatingBar";
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.label2,
this.label4,
this.ratingBar3,
this.ratingBar4,
this.ratingBar5,
this.ratingBar6,
this.ratingBar7,
this.label1,
this.ratingBar1,
this.ratingBar2,
this.ratingBar9,
this.label3,
this.ratingBar10});
this.panel1.Location = new System.Drawing.Point(300, 57);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(600, 847);
//
// label2
//
this.label2.HorizontalAlignment = Smobiler.Core.Controls.HorizontalAlignment.Center;
this.label2.Location = new System.Drawing.Point(55, 219);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(486, 62);
this.label2.Text = "ResourceID与SelectedResourceID设置图片资源和选中时图片资源,ResourceColor与SelectedResourceColor设置" +
"未选中时颜色和 选中时颜色;ImageType设置图像类型(设置Image时可以使用图片文件,设置FontIcon时可以使用FontIcon图标)\r\n";
//
// label4
//
this.label4.HorizontalAlignment = Smobiler.Core.Controls.HorizontalAlignment.Center;
this.label4.Location = new System.Drawing.Point(55, 594);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(486, 35);
this.label4.Text = "Value属性可设置当前评分值;ValueChanged事件在修改评分值时触发\r\n";
//
// ratingBar3
//
this.ratingBar3.Location = new System.Drawing.Point(158, 23);
this.ratingBar3.Name = "ratingBar3";
this.ratingBar3.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar3.ResourceID = "thumbs-o-up";
this.ratingBar3.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar3.SelectedResourceID = "thumbs-up";
this.ratingBar3.Size = new System.Drawing.Size(290, 35);
//
// ratingBar4
//
this.ratingBar4.Location = new System.Drawing.Point(158, 81);
this.ratingBar4.Name = "ratingBar4";
this.ratingBar4.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.ratingBar4.ResourceID = "thumbs-o-up";
this.ratingBar4.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(67)))), ((int)(((byte)(81)))));
this.ratingBar4.SelectedResourceID = "thumbs-up";
this.ratingBar4.Size = new System.Drawing.Size(290, 35);
//
// ratingBar5
//
this.ratingBar5.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.Image;
this.ratingBar5.Location = new System.Drawing.Point(158, 139);
this.ratingBar5.Name = "ratingBar5";
this.ratingBar5.ResourceColor = System.Drawing.Color.White;
this.ratingBar5.ResourceID = "logon";
this.ratingBar5.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(48)))), ((int)(((byte)(122)))), ((int)(((byte)(246)))));
this.ratingBar5.SelectedResourceID = "logon";
this.ratingBar5.Size = new System.Drawing.Size(290, 57);
//
// ratingBar6
//
this.ratingBar6.Location = new System.Drawing.Point(158, 478);
this.ratingBar6.Name = "ratingBar6";
this.ratingBar6.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(254)))), ((int)(((byte)(192)))), ((int)(((byte)(78)))));
this.ratingBar6.ResourceID = "thumbs-o-up";
this.ratingBar6.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(192)))), ((int)(((byte)(78)))));
this.ratingBar6.SelectedResourceID = "thumbs-up";
this.ratingBar6.Size = new System.Drawing.Size(290, 35);
this.ratingBar6.Value = 2;
this.ratingBar6.ValueChanged += new System.EventHandler(this.ratingBar6_ValueChanged);
//
// ratingBar7
//
this.ratingBar7.Location = new System.Drawing.Point(158, 536);
this.ratingBar7.Name = "ratingBar7";
this.ratingBar7.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192)))));
this.ratingBar7.ResourceID = "thumbs-o-up";
this.ratingBar7.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(67)))), ((int)(((byte)(81)))));
this.ratingBar7.SelectedResourceID = "thumbs-up";
this.ratingBar7.Size = new System.Drawing.Size(290, 35);
this.ratingBar7.Value = 5;
this.ratingBar7.ValueChanged += new System.EventHandler(this.ratingBar6_ValueChanged);
//
// 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 = "不同样式的RatingBar控件";
//
// label1
//
this.label1.HorizontalAlignment = Smobiler.Core.Controls.HorizontalAlignment.Center;
this.label1.Location = new System.Drawing.Point(55, 420);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(486, 35);
this.label1.Text = "NumRating属性可设置评价数量\r\n\r\n";
//
// ratingBar1
//
this.ratingBar1.Location = new System.Drawing.Point(158, 304);
this.ratingBar1.Name = "ratingBar1";
this.ratingBar1.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar1.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar1.Size = new System.Drawing.Size(290, 35);
//
// ratingBar2
//
this.ratingBar2.Location = new System.Drawing.Point(158, 362);
this.ratingBar2.Name = "ratingBar2";
this.ratingBar2.NumRatings = 3;
this.ratingBar2.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(185)))), ((int)(((byte)(229)))), ((int)(((byte)(99)))));
this.ratingBar2.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(229)))), ((int)(((byte)(99)))));
this.ratingBar2.Size = new System.Drawing.Size(290, 35);
//
// ratingBar9
//
this.ratingBar9.Location = new System.Drawing.Point(158, 652);
this.ratingBar9.Name = "ratingBar9";
this.ratingBar9.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar9.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar9.Size = new System.Drawing.Size(290, 35);
//
// label3
//
this.label3.HorizontalAlignment = Smobiler.Core.Controls.HorizontalAlignment.Center;
this.label3.Location = new System.Drawing.Point(55, 768);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(486, 35);
this.label3.Text = "Enable属性设置是否启用控件";
//
// ratingBar10
//
this.ratingBar10.Enabled = false;
this.ratingBar10.Location = new System.Drawing.Point(158, 710);
this.ratingBar10.Name = "ratingBar10";
this.ratingBar10.ResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar10.SelectedResourceColor = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(176)))), ((int)(((byte)(249)))));
this.ratingBar10.Size = new System.Drawing.Size(290, 35);
//
// demoRatingBar
//
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.demoRatingBar_Load);
this.Name = "demoRatingBar";
}
#endregion
private Smobiler.Core.Controls.Title title1;
private Smobiler.Core.Controls.Panel panel10;
private Smobiler.Core.Controls.Panel panel1;
private Smobiler.Core.Controls.Label label2;
private Smobiler.Core.Controls.Label label4;
private Smobiler.Core.Controls.RatingBar ratingBar3;
private Smobiler.Core.Controls.RatingBar ratingBar4;
private Smobiler.Core.Controls.RatingBar ratingBar5;
private Smobiler.Core.Controls.RatingBar ratingBar6;
private Smobiler.Core.Controls.RatingBar ratingBar7;
private Smobiler.Core.Controls.Label label1;
private Smobiler.Core.Controls.RatingBar ratingBar1;
private Smobiler.Core.Controls.RatingBar ratingBar2;
private Smobiler.Core.Controls.Label labTitle;
private Smobiler.Core.Controls.RatingBar ratingBar9;
private Smobiler.Core.Controls.Label label3;
private Smobiler.Core.Controls.RatingBar ratingBar10;
}
}