Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » [SOLVED] How to load another form using vb.net

[SOLVED] How to load another form using vb.net

Closed Thread
  #1 (permalink)  
Old
Newbie Coder
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] How to load another form using vb.net

Post split form original thread.

Can anybody tell me what the correct code is for loading and unloading different forms in VB.Net. It is not the same as VB6.
i am really confused.

Last edited by Nico; 03-11-08 at 09:21 AM.
  #2 (permalink)  
Old
Nico's Avatar
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,129
Thanks: 12
Thanked 93 Times in 89 Posts
dlakmal76, please don't bump 4 year old threads. Create your own next time.
  #3 (permalink)  
Old
digioz's Avatar
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,178
Thanks: 3
Thanked 59 Times in 11 Posts
Quote:
Originally Posted by dlakmal76 View Post
Post split form original thread.

Can anybody tell me what the correct code is for loading and unloading different forms in VB.Net. It is not the same as VB6.
i am really confused.
I am guessing you didn't like the answer from the original thread (which by the way WAS the correct answer). So here it is again:

Parent Form:

vb.net Code:
  1. Public Class Form1
  2.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  3.         Dim frmChild As New Form2
  4.         frmChild.Show()
  5.         ' To symbolize some work that needs to be done
  6.         System.Threading.Thread.Sleep(10000)
  7.         frmChild.Close()
  8.     End Sub
  9. End Class

Child Form:
vb.net Code:
  1. Public Class Form2
  2.     Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  3.     End Sub
  4. End Class

I am also attaching a sample VB.NET 2005 Project for your enjoyment.

Pete
Attached Files
File Type: zip FormLoadParentChild.zip (57.0 KB, 449 views)
__________________
  #4 (permalink)  
Old
Newbie Coder
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for all for send me coding
  #5 (permalink)  
Old
Newbie Coder
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
when i go to first form i want to close first form
i wrote this code
Code:
Dim frmFirst As New form1
frmFirst.hide()
but it is not functioning

Last edited by digioz; 03-12-08 at 01:05 PM. Reason: Please use CODE TAGS!
  #6 (permalink)  
Old
digioz's Avatar
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,178
Thanks: 3
Thanked 59 Times in 11 Posts
Quote:
Originally Posted by dlakmal76 View Post
when i go to first form i want to close first form
i wrote this code
Code:
Dim frmFirst As New form1
frmFirst.hide()
but it is not functioning
Try the following instead in the first (parent form):

vb.net Code:
  1. Dim frmChild As New Form2
  2.         frmChild.Show()
  3.         Me.Hide()
__________________
  #7 (permalink)  
Old
Newbie Coder
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for your codings now there is very important question
" I want to know After finished our project how i load my program using without vb.net only using .exe file. and also another computer (another computer mustn't installed vb.net) Please reply me soon dear
If I cant do this learning about vb.net is useless please help me
I hope your quick reply
  #8 (permalink)  
Old
digioz's Avatar
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,178
Thanks: 3
Thanked 59 Times in 11 Posts
When you run the project in Visual Studio, it generates an EXE file before running it in debug mode. You can find this EXE in the "project_dir\debug\bin" folder. Just copy this file and send it to whoever you want to give the application to, and assuming that they have the .NET Framework installed on their machine they can run it.

This only works for simple projects that don't have any dependencies. For larger projects that reference other libraries (DLL files), you have to also send the DLL files along with the EXE. The DLL files can also be found in the same directory.
__________________
  #9 (permalink)  
Old
Newbie Coder
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
before you told about that exe file i found it and when i bouble click on it, my programme starts but i copy this file to another computer then it is not functioning
now told me about .NET Framework what is this without having it can't we run the project. and tell me How i install .net framework to another computer (Tell me installing vb.net hole software is necessary or not)
I hope quick reply
Thank you for help me
  #10 (permalink)  
Old
Newbie Coder
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
and the error massage is this "The application failed to initialize properly (0xc0000135). Click on OK to terminate the application"
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
change form input value, on form load darksniperx JavaScript 4 10-04-07 10:22 PM
Form load and unload kruger007 Windows .NET Programming 8 08-27-05 06:46 AM
how to activate flash in VB upon form load alvinj2003 Visual Basic 2 01-10-05 10:34 PM
Size form in Load event RFickling Windows .NET Programming 0 10-06-04 10:47 PM
VB.NET - Show another form? Tesco Windows .NET Programming 11 06-04-04 07:09 AM


All times are GMT -5. The time now is 01:15 AM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.