[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Display an inherited form

Hello,

I have an inherited form that I want to display if a button is selected on the base form.

I do not receive compilation errors but when I select the button the inherited form is not displayed.

Here is the code for the select button:

Private Sub mnuVehicleCar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuVehicleCar.Click

        frmCar.ActiveForm.Enabled = True

    End Sub


0
Stella Pauley
Asked:
Stella Pauley
2 Solutions
 
ptakjaCommented:
That doesn't tell us much.

When you have coded for an inherited form,  the class declaration would look something like this:

Public Class MyForm
               Inherits Form1


All the form code for the items that are DIFFERENT from the parent form would go here.

End Class

Then to show it, you call the Show (or ShowDialog) method:

MyForm.Show

0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You would need to create an instance of it first though.  ;)

    Private Sub mnuVehicleCar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuVehicleCar.Click

        ' something like this....
        Dim mf As New MyForm
        mf.Show()

    End Sub

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now