none
How to implement Events and Delegates??? RRS feed

  • Question

  • I have one DropDownList which contains value 0 and 1. If i select an item then event should be occurred. And Message should be displayed as "Number Has Been Changed From 0 to 1". Is it Possible??? 

    Syed Yunus

    • Moved by Bob Wu-MT Thursday, May 17, 2012 6:30 AM (From:Windows Forms General)
    Wednesday, May 16, 2012 9:24 AM

Answers

  • Hi,

    can you specify exactly what you are trying to do?

    This forum covers Windows Forms - so I hope that you build up a Windows Forms Application? Then I have to confess, that I do not know a DropDownList control. So what control do you use exactly?

    I know a DropDownList control as ASP.Net control. In that case you should move to an ASP.Net forum that you can find at http://asp.net instead.

    In both cases you just subscribe to the event that is triggered when the selection is changed and in there you can trigger what you want to to e.g. open a MessageBox or display a PopUp.

    If this information is not enough for you: Please check out the tutorials! That are basic things to do and if you have problems with that you should start reading tutorials / introductions. If you have problems to understand something: Feel free to ask.

    With kind regards,

    Konrad

    • Proposed as answer by Rudedog2 Wednesday, May 16, 2012 6:04 PM
    • Marked as answer by Mr. WhartyModerator Thursday, May 31, 2012 3:25 AM
    Wednesday, May 16, 2012 10:02 AM

All replies

  • I need Complete Code for this. Plzz.. Thank You in advance..:)

    Syed Yunus

    Wednesday, May 16, 2012 9:25 AM
  • Hi,

    can you specify exactly what you are trying to do?

    This forum covers Windows Forms - so I hope that you build up a Windows Forms Application? Then I have to confess, that I do not know a DropDownList control. So what control do you use exactly?

    I know a DropDownList control as ASP.Net control. In that case you should move to an ASP.Net forum that you can find at http://asp.net instead.

    In both cases you just subscribe to the event that is triggered when the selection is changed and in there you can trigger what you want to to e.g. open a MessageBox or display a PopUp.

    If this information is not enough for you: Please check out the tutorials! That are basic things to do and if you have problems with that you should start reading tutorials / introductions. If you have problems to understand something: Feel free to ask.

    With kind regards,

    Konrad

    • Proposed as answer by Rudedog2 Wednesday, May 16, 2012 6:04 PM
    • Marked as answer by Mr. WhartyModerator Thursday, May 31, 2012 3:25 AM
    Wednesday, May 16, 2012 10:02 AM
  • The SelectedValueChanged event is raised when a different item in the list is selected (NB: the event may not fire if you re-select the same item through code).  Also, remember to set the DropDownStyle property to DropDownList if the user can only select from the values given.

    Out of interest - why use a list for "0" and "1", though?  Would a CheckBox not be more indicative?


    Regards, Phill W.

    Wednesday, May 16, 2012 11:37 AM
  • Hi Syed,

    As far as I know, Windows Form doesn't have a build-in DropDownList.

    Could you please tell us the real name of the Control?Or is it a custom control?

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 17, 2012 6:08 AM
  • Hi All,

    I am creating drop down list in my web application page(.aspx) by giving two values(0 and 1). If i select any value from DDL then an event should occur. 

    My question is how to raise this event??


    Syed Yunus

    Thursday, May 17, 2012 6:24 AM
  • Hi Syed,

    Web Application issue is not supported in this forum. Please create a new thread in the ASP.NET forum as Konrad's suggestion.

    Thank you for your understanding.

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 17, 2012 6:28 AM