Forum guidelines
AuthorQuestion
Adding a dropdown to a button in C#
Posted on: 29 Aug 2008
Hi All,

I am trying to implement a dropdown-button control in C#
which provides a list of actions.

Many Microsoft applicaitons use this kind of control. One
example is in the file open dialog box (goto
File -> Open -> File). The Open button has a dropdown
icon that gives two choices ('Open' and 'Open With').

Anybody has any idea of how to implement this control?

Ven Kates

AuthorReply
Re: Adding a dropdown to a button in C#
Posted on: 03 Sep 2008  
I think u can implement such by setting an event handler to the OnSelectedIndexChanged property of  the dropdown list.
Koushik De
Re: Adding a dropdown to a button in C#
Posted on: 04 Sep 2008  
I don't want to use dropdown list.

i just want to use button with additional options

Ven Kates

Re: Adding a dropdown to a button in C#
Posted on: 09 Feb 2009  
You could create a custom control based on the button control and add additional propereties and override the button OnClick event

One of the properties could be the list of options you talk about and a ListBox to take the options, then when the button is clicked a list box shows bellow the button to expose the options, your button control would also have the ListBox OnClick event where you would do your processing.

Does this make sense?

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.