User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 427,410 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,440 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 993 | Replies: 11
Reply
Join Date: Feb 2008
Posts: 2
Reputation: borito is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
borito borito is offline Offline
Newbie Poster

Form doesnt close or hide..

  #1  
Mar 3rd, 2008
Hi guys,

Im pretty new to vb .net. What im trying to do it I have 2 forms.

First of all I have created a Module with the code:
Module Module1

Public Start As New Form1
Public Input As New Form2

Public Sub main()
Application.Run(Input)
End Sub


Form1 has a button which when pressed opens Form2 which is ok but it just doesnt close down Form1. I have also tried using Form1.hide(), same results with this too.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
Form1.Close()

I've tried searching the net but I cant find anyone else who has this problem...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form doesnt close or hide..

  #2  
Mar 3rd, 2008
try this recovery :
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2. Form2.Show()
  3. Me.Dispose(False)
  4. End Sub
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Feb 2008
Posts: 2
Reputation: borito is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
borito borito is offline Offline
Newbie Poster

Re: Form doesnt close or hide..

  #3  
Mar 3rd, 2008
It switches between the forms but only after 4 times of switching... I think it finds some kind of error at this point...
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form doesnt close or hide..

  #4  
Mar 3rd, 2008
why u didn't use start and input?that it work when you used form1.show or form2.close?
i think it did not worked.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jan 2008
Posts: 24
Reputation: suganzeni is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
suganzeni suganzeni is offline Offline
Newbie Poster

Re: Form doesnt close or hide..

  #5  
Mar 4th, 2008
Hi
Why dont you try me.hide() instead of giving form1.Hide() or form1.Close()

private sub button1.click()
form2.show()
me.hide()
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form doesnt close or hide..

  #6  
Mar 4th, 2008
he was tried it suganzeni...
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jan 2008
Posts: 24
Reputation: suganzeni is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
suganzeni suganzeni is offline Offline
Newbie Poster

Re: Form doesnt close or hide..

  #7  
Mar 4th, 2008
Oh K fine.
Do you have any idea why this problem occurs.
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form doesnt close or hide..

  #8  
Mar 4th, 2008
i just confused when see his code, he declare input and start but didn't used it to call form.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jan 2008
Posts: 65
Reputation: SolTec is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 4
SolTec SolTec is offline Offline
Junior Poster in Training

Re: Form doesnt close or hide..

  #9  
Mar 5th, 2008
Aren't Start and Input reserved words in .NET?
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Form doesnt close or hide..

  #10  
Mar 5th, 2008
nope..i m using .net 2003. i didn't know in higher version.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb VB.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the VB.NET Forum

All times are GMT -4. The time now is 4:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC