Calling base class functions from a derived one
-
Ok. Thanks. I got that MDI child creation. Now I have an integer variable named
OpenWindows
that i declared asPublic
in myfrmMain
class. What I need now is how do I changeOpenWindows
' value fromfrmMain
's child -frmText
when it's closing? The code below doesn't work:Private Sub frmText_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Dim blabla As New frmMain blabla.OpenWindows -= 1 End Sub
-
Ok. Thanks. I got that MDI child creation. Now I have an integer variable named
OpenWindows
that i declared asPublic
in myfrmMain
class. What I need now is how do I changeOpenWindows
' value fromfrmMain
's child -frmText
when it's closing? The code below doesn't work:Private Sub frmText_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Dim blabla As New frmMain blabla.OpenWindows -= 1 End Sub
Not sure about your specific problem, or the wisdom of your approach, but to get to base class methods, use base. At least, that's now C# works. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
Ok. Thanks. I got that MDI child creation. Now I have an integer variable named
OpenWindows
that i declared asPublic
in myfrmMain
class. What I need now is how do I changeOpenWindows
' value fromfrmMain
's child -frmText
when it's closing? The code below doesn't work:Private Sub frmText_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Dim blabla As New frmMain blabla.OpenWindows -= 1 End Sub
To add to what Christian said, the word your looking for is
MyBase
. This will allow you access the base class members.MyBase.baseClassMethod()
RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome