Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default expose an event

    I had write a usercontrol ctrl1 with a textbox and two button, button1 and
    button2.
    I had drow ctrl1 in a windows form.
    I would like to know when i click button1 e when i click button2.

    Any ideas

    tnx


    Max3vil Guest

  2. Similar Questions and Discussions

    1. Can you expose an XSD with your web service?
      Hi, I'm building an ASP.NET web service and one of the methods returns an XML document (actually an XmlNode) and I'd like to associate the return...
    2. webservice to expose existing app functionality
      hi all, I have a c# socket server application (console application) that is responsible for maintaining an array of objects. The server does lots...
    3. How to expose WebCustomControl event
      Hi, I have been working on this for more than a day, with no joy and I was wondering if someone could help me with this: I am trying to create...
    4. Disabling Expose (F10 key)
      Director MX Mac OS 10.3 Okay so I am having some problems with Expose, specifically the F10 feature. It basically crashes the CD when it is...
    5. Expose Assembly As Web Service
      Hi, I have a class withing my ASP.Net project which I want other applications to use so I am going to create a separate Assembly for this. In...
  3. #2

    Default Re: expose an event

    >I had write a usercontrol ctrl1 with a textbox and two button, button1 and
    >button2.
    > I had drow ctrl1 in a windows form.
    > I would like to know when i click button1 e when i click button2.
    Publish an event, say ButtonClicked
    ButtonClickedEventArgs class may have a property of type Button pointing to
    the button clicked.

    Then, in usercontrol you may do something like:

    Page_Load(...)
    {
    button1.Clicked += myMethod;
    button2.Clicked += myMethod;
    }

    void myMethod(...)
    {
    if(ButtonClicked != null)
    {
    ButtonClicked(this, new ButtonClickedEventArgs((Button) sender));
    }
    }

    etc.

    --
    Happy Hacking,
    Gaurav Vaish | [url]http://www.mastergaurav.com[/url]
    [url]http://www.edujinionline.com[/url]
    [url]http://articles.edujinionline.com/webservices[/url]
    -------------------


    Gaurav Vaish \(www.EduJiniOnline.com\) Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139