auto generating methods/properties/events of contained controls

Locked auto generating methods/properties/events of contained controls

  • 2012年4月24日 下午 06:08
     
     

    Hi all,

    This may be covered already, but I have not idea what to use to search to find it and what I did try didn't work.

    Let's say I have a user control that contains 2 controls.  I keep those private and only expose the methods/properties of the user control.  Ok, now let's say that one of the user controls is a masked textbox.  I want to create properties and events in the user control that map to the unique features of the maksed textbox.

    I can do so by manually creating public properties in the user control and assigning whatever values I get to the controls cooresponding property and then repeat for methods and events. 

    I am hoping that there is a tool out there somewhere that I can use to auto generate the unique methods, properties, and events in a contained control into the containing control.  Can you point me to something that does this?

    I am using C# in VS 2010.

    Given that this is a class designing forum, I am hoping this is the right place.  If not, please let me know what would be the appropriate forum.

    Thanks,

    me


    me (and yes, I DO mark correct answers)

所有回覆

  • 2012年4月26日 上午 06:29
    版主
     
     

    Hi Fletcher,

    Welcome to the MSDN forum.

    As far as I know, this kind of tool is not contained by VS2010 at present. So I’m afraid that you need to achieve this by manually.

    You can submit your suggestions to User Voice site: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously, thanks.

    Have a nice day!


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

  • 2012年5月3日 上午 09:05
    版主
     
     

    Hi Fletcher,

    We haven’t heard from you for several days. I’d like to mark my reply as answer firstly. If you have any additional questions, you also can unmark the replay and post your question here. 

    Sorry for any inconvenience and have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

  • 2012年5月4日 下午 09:58
     
     

    Mark,

    1) I mark correct answers as an answer.  Unfortunately, your answer isn't really an answer.  So I unmarked it as it's a waste of time for people searching for an answer to find questions marked as answered but have no answer (one of my big gripes about msdn forums - but then, don't get me started on that topic....) 

    2) I believe that there is a way to do this, I just don't know how, hence this message.  The VS.NET editor does allow me to write code that runs in design mode.  But I have no information on that.  I was hoping that, in the least, I would get a link to some usefull references on how to write such code.

    If I come up with a solution or find a link to a resource, I will post it here and mark this as answered.  But it would be really helpful if someone at MS (and I have to believe there is someone who knows) would simply provide a real answer.

    Thanks 


    me (and yes, I DO mark correct answers)