Hi all,
I have the following problem: I created my own control inherited by the UltraTextEditor and just added two right buttons in right with icons and some code in the event handlers. Everything is fine design time, when I place my control in a form I can see my 2 buttons, but when I build and run the application the VS generates in the IntializeComponent() method code that add my buttons again and as result runtime I see 4 buttons instead 2. I’ll appreciate if anybody tell me why this is happened and how to prevent this.
Thanks in advance.
Where/when are you adding the buttons? It's sounds like wherever you are doing this is getting called twice, likely by VS's serialization mechanism.
-Matt
I add the buttons in the control constructor, I tried to do this in InticializeConponent() - the result is the same. When i add this control from the desgner in any form it generates the code that add the buttins again in the form constructor. I know that this is something related with the VS serialization mechanisum, but I don't know how to avoid this. Where in the inherited control I have to write the code in order to be executed only in the inferited control in to not be generated again from the desgner when i place the control anywhere?