Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with subclasses menus
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Menus
Titre:
Problems with subclasses menus
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Divers
Thread ID:
00963487
Message ID:
00963487
Vues:
35
Hi,

I've created a simple winform which serves as my main application background form. Onto this I've dropped a menu with various standard menu based operations, file / exit , about etc.

I placed this form in a class library so that I can subclass it to suit each application I write.

However, when I create a subclass based upon the form, none of the menu items respond to click events etc...

Here's the definition of my main application parent class form / menu.
Public Class MainAppForm
    Inherits BaseClasses.BaseForm

    Public Overridable Sub FileExitBar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileExitBar.Click
        Me.Close()
    End Sub
End Class
When I create my subclass I do this ;
Public Class PmMainAppForm
    Inherits BaseForms.MainAppForm

End Class
Visually it's the form with the same menus, but when I load it up, none of the menus items respond...

If I override the method at the subclass form level like this ;
Public Overrides Sub FileExitBar_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileExitBar.Click
    MsgBox("Instance on form works ok - Call the parent method")
    MyBase.FileExitBar_Click(sender, e)
End Sub
Then it works fine....

Am I missing something really fundemental here?

Many Thanks for reading, Bernard....
Répondre
Fil
Voir

Click here to load this message in the networking platform