Form Inheritance in Visual Studios designer implementations

Posted by CooPzZ on Stack Overflow See other posts from Stack Overflow or by CooPzZ
Published on 2010-04-30T06:50:36Z Indexed on 2010/04/30 6:57 UTC
Read the original article Hit count: 244

I'm in the process of Moving a project from Visual Studio 2003 to 2005 and have just seen the

The event Click is read-only and cannot be changed

when using inherited forms regardless of the Modifier on the Base Forms Controls will make all the Controls from the Base Readonly in the designer (Though in 2003 it didn't work this way).

I found this post metioning that this functionality has been temporarily" disabled http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/c25cec28-67a5-4e30-bb2d-9f8dbd41eb3a

Can anyone confirm whether this feature is used anymore? or how to program around it to be able to use the Base Control Events and still have a designer?

This is one way I've found but quite painfull when it used to do the plumbing for you. even just hiding one of the controls you have manually do now.

Public Class BFormChild

    Friend Overrides Sub cmdApply_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        MyBase.cmdApply_Click(sender, e)
    End Sub
    Friend Overrides Sub cmdCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        MyBase.cmdCancel_Click(sender, e)
    End Sub
    Friend Overrides Sub cmdOk_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        MyBase.cmdOk_Click(sender, e)
    End Sub

End Class

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about forms