Click here to Skip to main content
11,410,750 members (63,526 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET4.0
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 16-Nov-12 0:48am

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
0 Sergey Alexandrovich Kryukov 8,885
1 OriginalGriff 6,915
2 Maciej Los 3,390
3 Abhinav S 3,248
4 Peter Leow 3,059


Advertise | Privacy | Mobile
Web02 | 2.8.150414.5 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2015
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