当前位置: 首页>>代码示例>>C#>>正文


C# Form.Append方法代码示例

本文整理汇总了C#中Form.Append方法的典型用法代码示例。如果您正苦于以下问题:C# Form.Append方法的具体用法?C# Form.Append怎么用?C# Form.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Form的用法示例。


在下文中一共展示了Form.Append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UserForm

		public static  UserForm UserForm (Atom parent)
		{
			var f = new Form ().As<UserForm>();

			f.ClassName="form-horizontal";
			f.Append("<style>.form-horizontal .controls { margin-left: 100px; } @media (max-width: 480px) { .form-horizontal .controls { margin-left: 0px; } }  </style>");
			new Div(f, tb=>{
				tb.ClassName="nav";
				f.ButtonCreate=new ButtonIcon(tb, bt=>{bt.IconClass="icon-file icon-large"; bt.Disabled=true;});
				f.ButtonSave=new ButtonIcon(tb, bt=>{bt.IconClass="icon-save icon-large"; bt.Disabled=true; bt.Type="submit";});
				f.ButtonDestroy=new ButtonIcon(tb, bt=>{bt.IconClass="icon-remove icon-large"; bt.Disabled=true; });
			});

			new NumericInput (f, i => {
				i.Name = "Id";
				i.Hidden = true;
			});

			new TextField(f, i=>{i.Name="Name"; i.Text="Name"; i.Required=true;});
			new TextField(f, i=>{i.Name="City"; i.Text="City"; i.Required=true;});
			new TextField(f, i=>{i.Name="Address"; i.Text="Address"; });
			new DateField(f, i=>{i.Name="DoB"; i.Text="Birthday"; i.Picker.DateFormat="dd.mm.yy"; i.Required=true; });
			new EmailField(f, i=>{i.Name="Email"; i.Text="Email"; i.Required=true;});
			new IntField(f, i=>{i.Name="Rating"; i.Text="Rating"; });
			new RadioGroup<string> (f, rg => {
				rg.Required = true;
				rg.Text = "Level";
				rg.Name = "Level";
				rg.Add ("A");
				rg.Add ("B");
				rg.Add ("C");
			});

			new CheckField(f, i=>{i.Name="IsActive"; i.Input.Text="Is active?";});
			f.JQuery.Find("label[class='control-label']").CSS("width", "80px");

			f.CopyToUser= ()=>{
				User u = new User();
				f.Populate (u);
				return u;
			};

			parent.Append (f);
			return f;

		}
开发者ID:aicl,项目名称:Cayita.Javascript,代码行数:46,代码来源:UserForm.cs

示例2: Execute

		public static void Execute(Atom parent)
		{
			var form = new Form ();
			new Fieldset (form, fs => {
				new Legend (fs,"Legend");
				new Label(fs, "LabelText");
				new TextInput(fs, i=>{
					i.Placeholder="type something";
					i.Name="text";
				});

				new Span(fs, s=>{s.Text="Example block-level help text here"; s.ClassName="help-block";});

				new CheckField(fs, cf=>{
					cf.Name="allow";
					cf.Input.Text="Check me";
					cf.Input.Checked=true;
				});

				new SubmitButton(fs, b=>{
					b.Text="Send";
					b.Clicked+= (e) =>{ 
						e.PreventDefault();
						form.JQuery.Serialize().LogInfo();
					};
				});
				form.Append(fs);
			});

			parent.JQuery.Append("Default styles".Header (3)).Append (form);

			var sform = new Form ();
			new TextInput (sform, i => {
				i.Name="stext";
				i.Placeholder="search for";
				i.Required=true;
				i.ClassName="input-medium search-query";
				i.MaxLength=8;
				i.MinLength=3;
			});

			new SubmitButton(sform, b=>{
				b.Text="Search...";
				b.Clicked+= (e) =>{ 
					if(!sform.CheckValidity()) return ;
					sform.JQuery.Serialize().LogInfo();
				};
			});

			parent.JQuery.Append("Optional Layouts".Header (3)).Append("Search Form".Header(4)).Append (sform);

			var lform = new Form ();
			lform.SubmitHandler = f =>  f.JQuery.Serialize().LogInfo() ;
			lform.ClassName = "form-inline";
			new EmailInput (lform, i => {
				i.Placeholder = "your email";
				i.Required=true;
				i.Name="email";
			});

			new PasswordInput (lform, i => {
				i.Placeholder = "your password";
				i.Required=true;
				i.Name="password";
				i.MinLength=4;
			});

			new CheckInput (lform,i =>{
				i.Name="remember";
				i.Text="Remember?";
				i.Checked=true;
			});
					
			new SubmitButton (lform, b => b.Text = "submit");
	
			parent.JQuery.Append("Inline Form".Header(4)).Append (lform);

			new Form (f=>{
				f.ClassName="form-horizontal";

				new EmailField(f,i=>{
					i.Text="Email";
					i.Placeholder="your email";
					i.Input.Required=true;
					i.Name="email";
				});

				new PasswordField(f,i=>{
					i.Text="Password";
					i.Placeholder="your password";
					i.Input.Required=true;
					i.Input.MinLength=4;
					i.Name="password";
				});

				new CheckField(f, i=>{
					i.Input.Text="Remember";
					i.Input.Checked=true;
					i.Name="remember";
					new SubmitButton(i.Controls, b=>	b.Text="Login");
//.........这里部分代码省略.........
开发者ID:aicl,项目名称:Cayita.Javascript,代码行数:101,代码来源:Form.cs


注:本文中的Form.Append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。