Forms :: First Form Close And Second Form Open?

Feb 21, 2009

how can i do that? first form close and second open........i did that but first is only hiding not close

View 2 Replies


ADVERTISEMENT

Get A Button On Form A To Open Form B And Then Close (not Hide) Form A When Clicked?

Jun 12, 2009

get a button on form A to open form B and then close (not hide) form A when clicked?Background: I am coding a VSTO application for Excel in VB2008.

Private Sub FormAButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles FormAButton.Click
Dim FormB As New FormB

[code]....

View 1 Replies

Close The Startup Form And Open A New Form?

Jan 3, 2010

What I want is -

Dim filename = System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath.ToString)
Dim openForm As Object

[Code]....

View 4 Replies

Open To Another Form And The Current Form Will Close?

Nov 14, 2010

in my visual basic 2008, i have create like a hospital check form like just pressing some keyword the person data automatically open to another form and the current form will close since i am new to the visual basic 2008 i would like to ask what is the coding work to save the data of a person and how to retrieve a data of that person by pressing the keyword?

View 3 Replies

VS 2008 When Close The Main Form All The Forms Close?

Aug 30, 2009

my web browser is my main form and it has a number of sub forms , how can i set it that when i close the main form my sub forms dont close ?

At the moment when i close the main form all the forms close

View 2 Replies

Forms :: When Me.close() Doesn't Close Form

Mar 2, 2009

I have a situation where me.close() doesn't close the form. I have a form with a button with the code seen below. What happens when the button is clicked is the new form shows, but the original form(calling form) is still there. When I go into debug mode, I can see the me.close() execute, but nothing happens (calling form stays open). When I close the second form both forms close. If I comment out the call for the second form to open the first form closes without problem.

Private Sub cmdNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdNext.Click
Dim f As New frmOrder3

[Code].....

View 1 Replies

Forms :: Open A Child Form - Main Form Is Unresponsive?

Apr 20, 2011

When I open my child form,

frm_Analogs.ShowDialog()

It opens up the new form, but now I can not interact with my main form. It will not accept focus or allow me to interact with it.

Do I need to change the form type?

View 4 Replies

Close Form And Open A New One?

Oct 3, 2009

I never had problems with this before but now this ain't working right. What I want to do is open a new Form and close the Current Form that is already open. This code use to work for me

View 5 Replies

Close One Form And Open Another?

Jun 30, 2010

When I open my application I have the first form which opens as the Register form. When I press the Activate Button I want the MAIN form to open and I am using the code below as the last two line[code]...

View 5 Replies

How To Open And Close Form In Particular Time

Jul 6, 2010

Are there code can open and close forms in particular Time (reference is computer clock)..?
Example: in 08:00:00 open form1 and in 08:45:00 close it
And can I let the user enter the time to open and close the forms in the Basic Form?

View 13 Replies

Open Close Form From Class?

May 29, 2011

i am developing client-server app. i want to hide the opened form and open the another form when i recive the commnd from server. the client side has two form and one class.code(this code execute when i recive the msg):

Sub messagerecieved(ByVal message As String)
Dim msg() As String = message.Split("|") ' if a message is recieved, split it to process it
Select Case msg(0) 'process it by the first element in the split array

[code]....

View 1 Replies

Open Previous Form When I Close Immediate?

Nov 30, 2011

I need to open the previous form when i close the immediate form

View 5 Replies

Timer To Close/open Form?

May 17, 2009

I'm trying to make a splash screen that closes and loads the main form. I know this is very simple but for some reason I can't get it to work.

View 5 Replies

VS 2008 Open One Form And Then Close Another?

Dec 21, 2010

i've tried

On Form1
form2.show
me.close

[code].....

View 2 Replies

Cant Close Form With Serial Port Open?

Jul 8, 2008

I have a programme that accepts data from a serial port. If I close the port and then the form no problem. However if I try to close the form with out closing the port it appears to hang. I have tried closing the port in the forms close event but this did not solve the problem.The data recieved event is as below and UseData is the private sub which actually handles the data. Usedata contains the code line Dim InputText As String = SerialPort1.ReadLine
Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived

Me.Invoke(New myDelegate(AddressOf UseData), New Object() {})

End SubI am aware that this event runs on another thread and I have seen but cannot now find information about closing multiple active threads.or do I have to "uninvoke" the delegate

View 1 Replies

Close One Form And Open Another By Clicking On A Picturebox?

Jun 4, 2010

I'm trying to close one form and open another by clicking on a picturebox.

I'm using this code:

Me.Close()
Form1.Show

But it shows an error under me.close. I know this is obvious, but I'm sleepy and have been trying to figure it out for a while

View 21 Replies

Have One Form Close And Another Open When A Button Is Clicked?

Dec 13, 2010

I'm making an equation program and I want to have a main menu where the user can select an equation and then when one of the buttons is clicked, it closes the "selection" form and opens the appropriate form. For now I just have it set to show the proper form (for example, Form3.Show) but when I try to do something like Me.Close() after it, everything closes instead of keeping Form3 open.

View 2 Replies

How To Open And Close Form On Button Click

Sep 3, 2010

I am having a hard time with this. This is my code:
invoiceform.show()
me.close()
This is the only way I can think to do it, but it closes the application due to me.close(). How can I do this? Invoiceform is already running!

View 4 Replies

Set Time To Display Then Close And Open New Form?

May 17, 2011

I want my dialog to display for five seconds then open another dialog.

View 2 Replies

VS 2010 Open / Close Form From Class

May 31, 2011

I am developing client-Server Application, when Server send a command i want to open the form1 and close the form2, Client side has two forms and one class.when i recive the message from server,this code(written in class) execute but it cannot do anything.

[Code]....

View 5 Replies

VS 2010 Open One Form And Close The Current?

Jun 1, 2011

I have this button to open one form, and close the current form. When i click the button, the opened form closes and the program closes. In the button code, i open the one form, and in the one form's FormLoad is to close the first form.

View 2 Replies

Close All Forms Except For One Form?

Mar 8, 2011

how can i close all forms except for one form? vb.net 2003

View 4 Replies

Close Login And Open Main Window Form?

Feb 15, 2012

I am having a difficulty in this login form that I have made. The same as the premade template login in VB 2008 which I am using right now.Here's what happens when I run the program Log in form open > Log in successful > Main window appears *The login form still does not disappear.

I tried hiding it via me.hide() Log in form open > log in successful > Main window appears > log in form disappear.*Now the problem is that I cant close the whole application because the login form is still there only hidden. Again I tried putting in the "EXIT" button the code me.close() login.close()Log in form open > log in successful > Main window appears > log in form disappears > Exit application *Now everything seems to be ok now and then I found another problem.Instead of clicking the exit button I tried clicking the X button on the main window. There I found out that it only closes the main window. Therefore not closing the whole application because the login form is still hidden.

View 2 Replies

Reset Label Position Upon Form Open And Close?

Aug 13, 2011

I have a moving label in FrmAbout and when the form initially opens for the first time the label moves from right to left exactly how it should, but when that window is closed and then re-opened the label continues moving from the position it was in when the window was closed. How can I reset the labels position to the starting position when the form as been opened or closed?Here is the code that I currently have inside the Tick Event. I have tried resetting the timer, thinking that maybe that would work, but it has not.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Static i As Integer = 461
' i = 224
MovingNameLabel.SetBounds(i, 1, 223, 45)

[code]....

View 2 Replies

Close() Puts Forms Into Crazy Open/Close Loop?

Mar 4, 2011

In a program I'm working on, I want a "Loading..." dialog to close when it can't log in to a site using the username and password provided by the user. Basically, I have the code set up right because the function it is supposed to carry out when that occurs does work, but for some reason it ends up in some really weird stuff happening. In the Loading form, I have it set to do "Form1.Show()" and then "Me.Close()", assuming it would simply show the login form and then close the Loading form. However, when this happens, the Loading form closes, and then for only an instant Form1 shows, and then the Loading form shows and Form1 closes. This happens forever until I stop the debugging, and I can't seem to figure out why. Am I using the wrong method? What exactly does Me.Close() do anyways? All I want to do is close the form and open another

View 5 Replies

VS 2008 : Modal Form Hide Instead Of Close - Main Form Does Not Close

Mar 20, 2009

I have a main form that has a button with which a smaller form is shown. Think of the smaller form as the Find/Replace dialog in many applications, such as Notepad. It's important that the form is (what I believe is called) modal. What I mean is that it always stays on top of the main form. I ensure that by calling the Show method with "Me" as the owner argument. Whenever the small form loses focus it will not disappear into the background but stay visible (albeit out of focus). If you don't understand open up Notepad and have a look at the behavior of the Find/Replace dialog.

Here's my problem: instead of actually closing the form when the X is pressed, I want it to simply Hide itself, so its position and the state of any controls (checkboxes etc) is preserved automatically.To achieve this I simply cancel the FormClosing event and Hide it:

vb.net
Private Sub Form2_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing

[code]....

To show the form, I use the following (note the (Me) to make the main form the owner of the form; this ensures that it remains visible even when it is out of focus):

vb.net
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show(Me)
End Sub

Now. When I run my project, and open the Form2 (small form), then hide it again (by 'closing' it), I can no longer close the main form (Form1)! It seems the main form cannot close when the small form still exists (albeit invisible)...?? When I don't use the Me argument in the Show method, I don't get the behavior I want. I know I can set the TopMost property to True but that will also cause it to become visible on top of all the other forms, even windows not part of my application.

View 8 Replies

Forms :: Form Refuses To Close?

Dec 4, 2009

I have a method where I am making a trial period.When the date has exceded its trialperiod the program will not close.The code looks like this:

Public Sub DemoRestrict()
If My.Settings.dteStartDate = Nothing Then
My.Settings.dteStartDate = Now

[code].....

View 2 Replies

How Does A Windows.forms.form Close Itself

May 30, 2012

I created a new windows form application using VB 2010. I added no controls to the form. This is right "out of the box" app created by the VB windows form app wizard. I next added a FormClosed event handler. The handler gets called whenever I click the "x" on the form.Later I needed to close the form programatically in response to an event from an automation client. So I did something apparently farily dumb. I called "Me.Close()" Nothing happens. The form stays up on the screen. My FormClosed event handler is NOT called.The MSDN entry for "Close" doesn't give me a clue as to why this call doesn't work. Indeed, it seems to imply it should work.So I added a couple of lines of code after calling "Close()" since when I stepped across that line of code it appears that no other code would execute. Sure enough, as soon as I step over the call to Close(), I cannot step through any other lines of code.

Then I found another piece of form code while searching around and I found the code had what appeared to be an odd keyword just dangling in the code. The keyword, colored by the IDE as a VB keyword?So I typed "End" into my method and intellisense shows me "End Statement. Stops execution immediately". And it does. But is my FormClosed event handler called. No.I added "Inherits System.Windows.Forms.Form" to see if that had any effect. No change.So how does a form close itself programatically?

View 1 Replies

Calling Outlook Contacts Form From .net - A Dialog Is Open Close It?

Jan 24, 2012

I have made a little programme where the user can put in a name to search for a contact.The matches then fill a Datagrid and the user can then choose the one they want and the programm then opens the contact form (from outlook client)The Contact form opens ok, and it brings up the correct contact. If the user then selects the option to "Email" from that from I then get the error message"A Dialog is open" etc...

My code is as follows

Sub GetContact()
Dim objOutlook As Outlook.Application
Dim objNS As Outlook.NameSpace

[code]....

It seems to be due to Outlook being open or opening?

View 2 Replies

VS 2010 : Close And Open A Form - Make A Login For A Program?

Jul 16, 2010

How do I Close a Form and then open a new one straight away? Im trying to make a Login for a Program, but I want the Login Box to open first, then disappear when the credentials are correct and a new Form to load.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved