Events getting deleted

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Lloyd

    Events getting deleted

    Hi,

    I am using c# as my code for ASP.Net and getting some annoying behaviour

    I am creating custom handlers for events in the InitializeCompo nent section
    of a user control but when I redesign the form they are getting deleted and
    replaced by the Handlers for all of the controls in the form.

    Also, I have changed some of controls from protected to public, these also
    get overwritten.

    Is there a way of stopping this?

    Thanks for an help

    Steve Lloyd


  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: Events getting deleted

    hi,

    you should not change nothing inside the #region used by the designer, if
    you do so you SHOULD not change to design mode again.

    InitializeCompo nent happens to be there, hence you should not change it.

    can you use the form_load or the constructor instead?

    cheers,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation


    "Steve Lloyd" <steveRemoveThi sNow@livenowpay later.co.uk> wrote in message
    news:eCnw$$ycFH A.2552@TK2MSFTN GP14.phx.gbl...[color=blue]
    > Hi,
    >
    > I am using c# as my code for ASP.Net and getting some annoying behaviour
    >
    > I am creating custom handlers for events in the InitializeCompo nent
    > section of a user control but when I redesign the form they are getting
    > deleted and replaced by the Handlers for all of the controls in the form.
    >
    > Also, I have changed some of controls from protected to public, these also
    > get overwritten.
    >
    > Is there a way of stopping this?
    >
    > Thanks for an help
    >
    > Steve Lloyd
    >[/color]


    Comment

    Working...