Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Calling base class functions from a derived one

Calling base class functions from a derived one

Scheduled Pinned Locked Moved Visual Basic
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Verolix
    wrote on last edited by
    #1

    Ok. Thanks. I got that MDI child creation. Now I have an integer variable named OpenWindows that i declared as Public in my frmMain class. What I need now is how do I change OpenWindows' value from frmMain'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

    C D 2 Replies Last reply
    0
    • V Verolix

      Ok. Thanks. I got that MDI child creation. Now I have an integer variable named OpenWindows that i declared as Public in my frmMain class. What I need now is how do I change OpenWindows' value from frmMain'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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • V Verolix

        Ok. Thanks. I got that MDI child creation. Now I have an integer variable named OpenWindows that i declared as Public in my frmMain class. What I need now is how do I change OpenWindows' value from frmMain'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

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups