Sign in to follow this  
Fixxer

C#: Using Combo Boxes

Recommended Posts

Quote:
Original post by Fixxer
What is the event handler for when some one makes a selection in a combo box?

You've asked a lot of these questions lately. Are you sure you're making a determined effort to check the documentation first? The MSDN docs that come with any copy of Visual Studio contain information on pretty much every single public and protected class member in the framework.

For instance, I found the answer to your question in about three seconds merely by scanning the ComboBox event handler list: SelectedIndexChanged

Also, from our Forum FAQ:

Quote:
from the Forum FAQ
(1) Ask intelligent questions. A question is not intelligent if its answer is something you could find with a little bit of effort or a quick Google search.

Share this post


Link to post
Share on other sites
Aye sirs and or ma ams.
Here is a better question then :)

I am having trouble typing out event handlers.
I cant find whats wrong with this one, the intellisense even completed it for me.

WebBrowersWin.Navigating +=new WebBrowserNavigatingEventHandler(WebBrowersWin_Navigating);

Share this post


Link to post
Share on other sites
I know, I have everything typed correctly and in the correct spots, but I keep getting this error.

Error 1 The name 'WebBrowersWin_Navigating' does not exist in the current context C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\Xiemsoft Web Portal\Xiemsoft Web Portal\Form1.cs 28 78 Xiemsoft Web Portal

WebBrowersWin.Navigating += new WebBrowserNavigatingEventHandler(WebBrowersWin_Navigating);

and it underlines WebBrowersWin_Navigating

Share this post


Link to post
Share on other sites
Type:

WebBrowersWin.Navigating +=

And the IntelliSense should bring up the correct right hand side. Hit tab to fill it in. Then hit tab again to automatically create a function that receives the event.

Also, the better way to do it is to open the form in the designer view, right-click on the control, select Properties. In the Properties view, click the little lightning-bolt icon to see a list of events. Double-click the blank space to the right of the event you want to handle, and it will automatically set it up and take you right to where you can type code for that event.



~BenDilts( void );

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this