中组件计划
2021-09-06 01:47 来源:璧山县养生网
五. 文中源程序代码(px)和执行的界面:
下图是执行了下列源程序代码(px)后,生成的界面:
px源程序代码如下:
<% @ Page Language = \"C#\" %>
<html >
<head >
<title > CheckBoxList组件演示程序 </title >
<script runat = \"server\" >
protected void Button_Click ( object sender , EventArgs e )
{
//组件中的检查框中的文本和选框的排列位置
switch ( cboAlign . SelectedIndex )
{
case 0 :
ChkList . TextAlign = TextAlign . Left ;
break ;
case 1 :
ChkList . TextAlign = TextAlign . Right ;
break ;
}
//组件中各个检查框布局
switch ( cboRepeatLayout . SelectedIndex )
{
case 0 :
http://gybdf.999ask.com/,广元哪个医院治疗白癜风最好 ChkList . RepeatLayout = RepeatLayout . Table ;
break ;
case 1 :
ChkList . RepeatLayout = RepeatLayout . Flow ;
break ;
}
//组件中各个检查框排列方向
switch ( cboRepeatDirection . SelectedIndex)
{
case 0 :
ChkList . RepeatDirection = RepeatDirection . Vertical ;
break ;
case 1 :
ChkList . RepeatDirection = RepeatDirection . Horizontal ;
break ;
}
//组件中各个检查框的排列行数
try
{
int cols = int . Parse ( xt ) ;
ChkList . RepeatColumns = cols ;
}
catch ( Exception )
{
}
lblResult . Text = \"\" ;
for ( int i = 0 ; i < ChkList . Items . Count ; i++ )
{
if( ChkList . Items [ i ] . Selected )
{
lblResult . Text += ChkList . Items [ i ] .Text + \" <br > \" ;
}
}
}
</script >
</head >
<body >
<form runat = \"server\" >
<h1 align = center > CheckBoxList组件演示程序 </h1 >
<table >
<tr >
<td > 组件中的文本排列位置: </td >
<td >
<asp:DropDownList id = cboAlign runat = \"server\" >
<asp:ListItem > 居左 </asp:ListItem >
<asp:ListItem > 居右 </asp:ListItem >
</asp:DropDownList >
</td >
</tr >
<tr >
<td > 组件中各个条目布局: </td >
<td >
<asp:DropDownList id = cboRepeatLayout runat = \"server\" >
<asp:ListItem > 表格型 </asp:ListItem >
<asp:ListItem > 紧凑型 </asp:ListItem >
</asp:DropDownList >
</td >
</tr >
<tr >
<td> 组件中各个条目排列方向:</td >
<td >
<asp:DropDownList id = cboRepeatDirection runat = \"server\" >
<asp:ListItem > 水平方向 </asp:ListItem >
<asp:ListItem > 垂直方向 </asp:ListItem >
</asp:DropDownList >
</td >
</tr >
<tr >
<td > 组件中各个条目排列行数: </td >
<td > <asp:TextBox id = \"txtRepeatCols\" runat = \"server\" /> </td >
</tr >
</table >
<br >
请选择你所需要学习的计算机语言类型:
<br >
<asp:CheckBoxList id = \"ChkList\" RepeatDirection = Horizontal runat = \"server\" >
<asp:ListItem > Visual C++ .Net </asp:ListItem >
<asp:ListItem > Visual C# </asp:ListItem >
<asp:ListItem > </asp:ListItem >
<asp:ListItem > </asp:ListItem >
<asp:ListItem > Visual J# </asp:ListItem >
</asp:CheckBoxList >
<br >
<asp:Button Text = \"提交\" runat = \"server\" onclick = \"Button_Click\" />
<h1 > <font color = red > 你选择的计算机语言类型为: </font > </h1 >
<asp:Label id = lblResult runat = \"server\" />
</form >
</body >
</html >
六. 总结:
其实CheckBoxList组件也是一个服务器端组件。本文介绍了CheckBoxList组件中的一些主要的属性和方法,并且通过一个比较典型的例子说明了在页面中如何进行与CheckBoxList组件相关的编程,其实对于另外一个比较重要的组件--CheckBox来说,他们中有许多的相似之处,掌握了CheckBoxList组件的用法大致也就掌握了CheckBox组件的用法。
查看本文来源
济南哪里治疗白癜风好成都看男科专科医院
骨关节科
-
葡萄牙生活家的美德,发掘咖啡鲜为人知的绝妙用处! | 微课堂
在在是一年一度的招生季,想必勾起了不少果树的真情自述。不告诉他有多少小伙伴和小编一样,从大一起指望一杯冰淇淋必须提神醒脑,现今纯净已经生活习惯了靠冰淇淋“续命”的日常生活而在果树牙人的日常...
-
亚马逊Fire 7平板的电脑将搭载Fire OS操作系统,升级Android 11
IT之家 5 月 22 日消息,雨林新款机壳电脑 Fire 7 将搭载该公司的 Fire OS UNIX的新版本 ——Fire OS 8,其将基于 Android 11,之前的 Fire OS 7 是基于 Android 9,于 2018 年发布。 根据雨林的开发者文档,该预览可能助长一些更...
-
肺突起是如何产生的呢?良性的概率远大于恶性!
作者:江苏亦然元堂 什么是呼吸系统下颚?呼吸系统下颚是幽像学的描述,指的是在胸片或者CT中都会发现的呼吸系统内的小于75px的阴幽,可以是单个也可以是多个。那么,呼吸系统下颚是如何显现出的呢? 受过外...
-
长春视觉艺术生文化课英语学习方法,高三学校分享
虽是如此,但那些在今后直译总成绩不是不错的夫妻俩也可不太过责怪。 如果你贝尔努力,贝尔细心,就算不能变成直译130+的龙神,但也可以受益一个极少的名次。 就让过来人丢下过的路,汲取充分,自制努力吧...
-
爱人是从互相爱慕到相互彼此产生了解
所选男人,还是所选个疼你的好。真情,缘故就是个倒是静的词儿。它不只是简单的形而上,更是一些实实在在的呵护。真情一个人,得给对方一些犹如、摸得着的确信。一万句柔情蜜意,不如一句“放着,我来。...
-
仅先于4日,第四批同业存单基金获批,这类产品为何突然爆火?
仅隔4日,第四批票券商存单外资基金获批了!5年初20日,嘉实外资基金、汇添富外资基金、华宝外资基金、华泰柏瑞外资基金、景顺长城外资基金为该公司票券商存单标准普尔外资基金正式获批。 而在5年初16日,...