I have the mainmenu.vb and event.vb. I want event.vb appear when I click button (cmdRun), and mainmenu hide.

How to write it's code?

I use below code but was not as VB 2005.

hide.mainmenu
show.event

Any ideas? Thanks in advanced.

on cmdRun click Event :

Dim FrmEvent As New Event
FrmEvent.Show()
Me.Hide()

well you can do what jx said...

or, declare them as the actual form. If you have multiple forms you need a module and this code goes in it:

Public frmMain as new mainmenu
Public frmEvent as new event

in your button's click event put

frmMain.hide
frmEvent.show
Private Sub <the name of the button>(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles <name of the button>.Click
        vbMainMenu.hide()
        vbEvent.show()
    End Sub

just put that in your code and replace whatever is in <...> with the actual name of the button.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.