可输入的下拉列表用法,
1.在html中添加链接<link rel="STYLESHEET" type="text/css" href="ComboBox.css" />
2.在使用的地方添加如:<td id="modified" width="175px">
3.最后添加脚本代码:<script src=ComboBox.js></script><script language=javascript>
dm=new ComboBox("dm");
dm.add(
new ComboBoxItem("barge","barge"),
new ComboBoxItem("benluc","benluc"),
new ComboBoxItem("benlieeeeck","benlieeeeck"),
new ComboBoxItem("taco","taco")
);</script>或者
<script src="ComboBox.js"></script>
<script>
dm=new ComboBox("dm");
<%System.Data.DataTable dtPro=DataAccess.dataSet("SELECT distinct(Project) FROM BudgetProject").Tables[0];
for (int i = 0; i < dtPro.Rows.Count; i++){%>
dm.add(new ComboBoxItem('<%=dtPro.Rows[i][0].ToString()%>','<%=dtPro.Rows[i][0].ToString()%>'));
<% } %> </script>
4.在<title>之间添加
<script language="javascript">
function changeToCS()
{
document.getElementById("TxtSearch").value = dm.value;
}</script>
5.在c#中使用要在前台添加控件如:<input type="hidden" id="txtCombo" runat="server" />才能通过txtCombo.Value来调用控件的值.
**********************************combo.Css *************************************************
.combo-button {
cursor: hand;
cursor: pointer;
height: 20px;
border: 1px solid rgb(120,172,255);
padding: 0;
background: rgb(234,242,255);
width: 14px;
vertical-align: baseline;
font-size: 8pt;
font-family: Webdings, Marlett;
}
.combo-hilite {
cursor: hand;
cursor: pointer;
background: rgb(234,242,255);
border: 1px solid rgb(120,172,255);
color: black;
font-family: verdana;
font-size: 9pt;
}
.combo-item {
cursor: hand;
cursor: pointer;
background: white;
border: 1px solid white;
color: black;
font-family: verdana;
font-size: 9pt;
}
.combo-input {
border: 1px solid rgb(120,172,255) !important;
width: 138px !important;
vertical-align: baseline;
}
.combo-list table {
table-layout: fixed;
width: 149px;
}
.combo-list {
bo