README.md

December 5, 2022 ยท View on GitHub

Form Show

Description

vb6 Form.show method in vb.net

More Info

Submitted On
ByHanafiah
LevelBeginner
User Rating3.0 (24 globes from 8 users)
CompatibilityVB.NET
CategoryDebugging and Error Handling
World.Net (C#, VB.net)
Archive File

Source Code

I'm beginner in VB.Net, just to share some tips Let says you have 2 form, Form_1 and Form_2. Inside Form_1 you have 1 command button called command_1. if you show Form_2 when press command_1. in VB6 just can use

Form_2.show

But how to do it in vb.net?
Private Sub command_1_Click(ByVal Sender As Object, ByVal e as EventArgs) Handles command_1.Click
Dim frm As New Form_2()
frm.Show()
End Sub


but if you don't need to show new form2 every time you press command_1. just put your declaration outside your sub. like this

Dim frm As New Form_2()
Private Sub command_1_Click(ByVal Sender As Object, ByVal e as EventArgs) Handles command_1.Click
frm.Show()
End Sub