![]() |
Visual Basic HELP
I use VB 2008 Express Edition, and I cannot get my multiple form application to work correctly. I am trying to get frmNext to show up after frmInput is done. So, in frmInput's button click event, I type in strName = TextBox1.Text, frmNext.Show(), and Unload frmInput. Unload does not work in vb 2008 anymore I guess, because it gave me an error. So, I typed in Me.Close(), which closes the application altogether. So, I decided to go into frmNext's form load event and type in Me.Text = strName and frmInput.Close(), which causes the entire program to close. I need help getting frmNext to show up and frmInput to close down.
|
Ah im not that great yet but could you post the whole code? I could probly help ive been using it for a few years now.
|
Option Explicit On
Module Module1 Public strName As String End Module Option Explicit On Public Class frmInput Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click strName = TextBox1.Text frmNext.Show() Me.Close() End Sub End Class Option Explicit On Public Class frmNext Private Sub frmNext_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Text = strName End Sub End Class |
Create a module with a Sub "Main"
Code:
Imports System.Windows.FormsCode:
Private closeApp as Boolean = TrueCode:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click |
Whenever I wanted to do something like that back in the day, i'd simply change the visibility of the form
frm.setVisible(true); to display it frm.setVisible(false); to hide it |
Quote:
|
After some quick perusing ...
You may just be able to go into your projects properties page, and under the Application tab set the "Shutdown mode" to "After last form closes" instead of the default "When main form closes". |
| All times are GMT. The time now is 04:40 AM. |
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.