借鉴别人的改了一下~
HTML:
<style>
.dropdownlist { MARGIN-LEFT: -100px; WIDTH: 118px }
</style>
.dropdownlist { MARGIN-LEFT: -100px; WIDTH: 118px }
</style>
<div style="POSITION:relative">
<SPAN style="MARGIN-LEFT: 100px; OVERFLOW: hidden; WIDTH: 18px">
<asp:dropdownlist id="DropDownList1" runat="server" CssClass="dropdownlist" AutoPostBack="True">
<asp:ListItem Value="1">横线</asp:ListItem>
<asp:ListItem Value="2">竖线</asp:ListItem>
</asp:dropdownlist>
</SPAN>
<INPUT style="LEFT: 0px; WIDTH: 100px; POSITION: absolute" size="11" name="box2" id="Text1"
runat="server">
</div>
<SPAN style="MARGIN-LEFT: 100px; OVERFLOW: hidden; WIDTH: 18px">
<asp:dropdownlist id="DropDownList1" runat="server" CssClass="dropdownlist" AutoPostBack="True">
<asp:ListItem Value="1">横线</asp:ListItem>
<asp:ListItem Value="2">竖线</asp:ListItem>
</asp:dropdownlist>
</SPAN>
<INPUT style="LEFT: 0px; WIDTH: 100px; POSITION: absolute" size="11" name="box2" id="Text1"
runat="server">
</div>
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.Text1.Value = this.DropDownListArcClass.SelectedItem.Text;
}
{
this.Text1.Value = this.DropDownListArcClass.SelectedItem.Text;
}
来源:https://www.cnblogs.com/avril2005/archive/2005/04/27/146291.html