我想实现鼠标点击在TEXTBOX中时 ,dropdownlist显示,鼠标离开TEXTBOX时,dropdownlist隐藏。
帮帮忙

解决方案 »

  1.   

    TextBox1.TextChage()事件中写
    if(DropDownlist1.visible)
    {
    DropDownlist1.visible=false;
    }
    else
    {
    ....
    }
      

  2.   

    记得吧TextBox的OutPostBack属性设置为True
      

  3.   

    js函数:
    function hide()
    {
    //类似代码
    document.getElementById("ddl").stytle="";//
    }function show()
    {
    //类似代码
    document.getElementById("ddl").stytle="";//
    }
    <asp:textbox id="txt" runat="server" onfocus="hide();" onblur="show();"></textbox>
    <asp:dropdownList id="ddl" runat="server"></asp:dropdownlist>
      

  4.   


        <input type="text" onmouseover="showHideDropdown(true)" onmouseout="showHideDropdown(false)" />
        <br />
        <asp:DropDownList ID="ddl" runat="server">
            <asp:ListItem>a</asp:ListItem>
            <asp:ListItem>b</asp:ListItem>
        </asp:DropDownList>
        
        
        </form>
        
        <script type="text/javascript">
            function showHideDropdown(type) {
                document.getElementById('<%= ddl.ClientID %>').style.display = type ? "inline" : "none";
            }
        </script>
      

  5.   

    七楼的,我要实现的不是那样的效果啊,我鼠标点在TEXTBOX框中,DROPDOWNLIST出来并可以选择,
      

  6.   

    js 写,onfocus 和onblur事件
      

  7.   

    四楼的可以
    function hide()
    {
    //类似代码
    document.getElementById("ddl").stytle="none";//
    }function show()
    {
    //类似代码
    document.getElementById("ddl").stytle="";//
    }