Click here to Skip to main content
12,350,971 members (32,946 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET4
hi
friends

my task is

i have one text box when i move mouse on text box it will display like button on right end ,when i click on button drop down list items will displayed after mouse will removed on the text box it will show like text box itself.


please help
Posted 15-Nov-12 23:48pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,
why don't you use comboBox for this type of situation.
try this one,

take a comboBox control, write the following code under the MouseEnter event and MouseLeave events of comboBox.

private void comboBox1_MouseEnter(object sender, EventArgs e)
        {
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown;
        }
 
        private void comboBox1_MouseLeave(object sender, EventArgs e)
        {
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
        }
And also write the following code under the Form Load event
private void Form1_Load(object sender, EventArgs e)
        {
            this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
        }
I hope this helps to you.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160621.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100