复选空件和复选组控件(CheckBox和CheckBoxList)
来源:互联网 发布:哪种论坛源码比较好 编辑:程序博客网 时间:2024/05/22 11:50
复选空件和复选组控件(CheckBox和CheckBoxList).aspx
<%...@ Page Language="C#" AutoEventWireup="true" CodeFile="复选空件和复选组控件(CheckBox和CheckBoxList).aspx.cs" Inherits="复选空件和复选组控件_CheckBox和CheckBoxList_" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>复选空件和复选组控件(CheckBox和CheckBoxList)</title>
</head>
<body>
<form id="form1" runat="server">
<div>
复选控件的基本属性都和上一个例子差不多,但是复选空间没有GroupName属性。<br />
<asp:CheckBox ID="cb1" runat="server" Style="position: relative" AutoPostBack="True" OnCheckedChanged="cb1_CheckedChanged" Text="文字具有上划线" />
<br />
<br />
<asp:CheckBox ID="cb2" runat="server" Style="position: relative" AutoPostBack="True" OnCheckedChanged="cb2_CheckedChanged" Text="文字具有下划线" /><br />
<br />
<asp:CheckBox ID="cb3" runat="server" Style="position: relative" AutoPostBack="True" OnCheckedChanged="cb3_CheckedChanged" Text="文字具有删除线" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Style="position: relative" Text="测试使用的文字"></asp:Label><br />
<br />
注意要将每一个CheckBox都设置为AutoPostBack哦<br />
<br />
下面的类子我们还是使用上面的文字,用CheckBoxList做<br />
<br />
<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged"
Style="position: relative">
<asp:ListItem>文字具有上划线</asp:ListItem>
<asp:ListItem>文字具有下划线</asp:ListItem>
<asp:ListItem>文字具有删除线</asp:ListItem>
</asp:CheckBoxList><br />
<br />
注意要将每一个CheckBoxList设置为AutoPostBack哦</div>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>复选空件和复选组控件(CheckBox和CheckBoxList)</title>
</head>
<body>
<form id="form1" runat="server">
<div>
复选控件的基本属性都和上一个例子差不多,但是复选空间没有GroupName属性。<br />
<asp:CheckBox ID="cb1" runat="server" Style="position: relative" AutoPostBack="True" OnCheckedChanged="cb1_CheckedChanged" Text="文字具有上划线" />
<br />
<br />
<asp:CheckBox ID="cb2" runat="server" Style="position: relative" AutoPostBack="True" OnCheckedChanged="cb2_CheckedChanged" Text="文字具有下划线" /><br />
<br />
<asp:CheckBox ID="cb3" runat="server" Style="position: relative" AutoPostBack="True" OnCheckedChanged="cb3_CheckedChanged" Text="文字具有删除线" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Style="position: relative" Text="测试使用的文字"></asp:Label><br />
<br />
注意要将每一个CheckBox都设置为AutoPostBack哦<br />
<br />
下面的类子我们还是使用上面的文字,用CheckBoxList做<br />
<br />
<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged"
Style="position: relative">
<asp:ListItem>文字具有上划线</asp:ListItem>
<asp:ListItem>文字具有下划线</asp:ListItem>
<asp:ListItem>文字具有删除线</asp:ListItem>
</asp:CheckBoxList><br />
<br />
注意要将每一个CheckBoxList设置为AutoPostBack哦</div>
</form>
</body>
</html>
复选空件和复选组控件(CheckBox和CheckBoxList).aspx
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class 复选空件和复选组控件_CheckBox和CheckBoxList_ : System.Web.UI.Page
...{
protected void Page_Load(object sender, EventArgs e)
...{
}
protected void cb1_CheckedChanged(object sender, EventArgs e)
...{
if (this.cb1.Checked == true)
...{
this.Label1.Font.Overline = true;
}
else
...{
this.Label1.Font.Overline = false;
}
}
protected void cb2_CheckedChanged(object sender, EventArgs e)
...{
if (this.cb2.Checked == true)
...{
this.Label1.Font.Underline = true;
}
else
...{
this.Label1.Font.Underline = false;
}
}
protected void cb3_CheckedChanged(object sender, EventArgs e)
...{
if (this.cb3.Checked == true)
...{
this.Label1.Font.Strikeout = true;
}
else
...{
this.Label1.Font.Strikeout = false;
}
}
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
...{
if (this.CheckBoxList1 .Items [0].Selected )
...{
this.Label1.Font.Overline = true;
}
else
...{
this.Label1.Font.Overline = false;
}
if (this.CheckBoxList1 .Items [1].Selected )
...{
this.Label1.Font.Underline = true;
}
else
...{
this.Label1.Font.Underline = false;
}
if (this.CheckBoxList1 .Items [2].Selected )
...{
this.Label1.Font.Strikeout = true;
}
else
...{
this.Label1.Font.Strikeout = false;
}
}
}
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class 复选空件和复选组控件_CheckBox和CheckBoxList_ : System.Web.UI.Page
...{
protected void Page_Load(object sender, EventArgs e)
...{
}
protected void cb1_CheckedChanged(object sender, EventArgs e)
...{
if (this.cb1.Checked == true)
...{
this.Label1.Font.Overline = true;
}
else
...{
this.Label1.Font.Overline = false;
}
}
protected void cb2_CheckedChanged(object sender, EventArgs e)
...{
if (this.cb2.Checked == true)
...{
this.Label1.Font.Underline = true;
}
else
...{
this.Label1.Font.Underline = false;
}
}
protected void cb3_CheckedChanged(object sender, EventArgs e)
...{
if (this.cb3.Checked == true)
...{
this.Label1.Font.Strikeout = true;
}
else
...{
this.Label1.Font.Strikeout = false;
}
}
protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
...{
if (this.CheckBoxList1 .Items [0].Selected )
...{
this.Label1.Font.Overline = true;
}
else
...{
this.Label1.Font.Overline = false;
}
if (this.CheckBoxList1 .Items [1].Selected )
...{
this.Label1.Font.Underline = true;
}
else
...{
this.Label1.Font.Underline = false;
}
if (this.CheckBoxList1 .Items [2].Selected )
...{
this.Label1.Font.Strikeout = true;
}
else
...{
this.Label1.Font.Strikeout = false;
}
}
}
- 复选空件和复选组控件(CheckBox和CheckBoxList)
- CheckBox控件和CheckBoxList控件
- 表单控件(复选框checkbox和单选择按钮radio)
- 复选框checkbox控件
- ASP.Net WEB控件 [ 复选框组 CheckBoxList控件 ]
- CheckBox复选框判断空
- 按钮和复选框控件
- buttion和checkbox实现全选、复选
- checkbox复选框的全选和全不选
- HTML复选框和单选框 radio checkbox
- 初学单选框RadioButton和复选框CheckBox
- checkbox 复选框文本和文字对齐
- 单选框(RadioButton)和复选框(CheckBox)
- 复选框的实现(CheckBox和MenuItemImage)
- CheckBoxList控件和CheckBox 4-7
- iCheck空件,美化后的checkbox和radiobox控件
- CheckBox和CheckBoxList练习
- 单选控件RadioButton_复选控件CheckBox
- C#中的反射
- Delphi 函数大全3
- LoadRunner中的openssl的一些相关命令
- WEB打印
- C++入门练习 76题(7)
- 复选空件和复选组控件(CheckBox和CheckBoxList)
- Oracle和SUN Solaris内核参数
- IP 地理位置查询类
- 水晶报表的使用技巧
- oracle update语句
- 判断是否非法提交数据
- 采用ROM监控器的调试技巧分析- -
- 判断用户名是否包含非法字符
- 判断字符是否为中文