IDE :: Close Form-1 At The Time Of Form2.show?

Mar 1, 2009

My Project having form-1 & form-2. Project starts with Form-1.From the form-1, button1 - click() I want to close the form1 and from2.showform2.show showing form2, but the form-1 is also still opened. How to close form-1?I tried from Form-1 as me.close(). then Form-2 is not showing.So how to close form-1 at the time of form2.show?

View 2 Replies


ADVERTISEMENT

Show Form1 If Form2 Close

May 10, 2010

I am having a problem with the form. I want to make that if the form2 close, the form1 will be shown. I've tryed this code but it doesn't work.

If me.close then
form1.show

View 6 Replies

Closing Forms - When I Show The Form3, It Will Close The Form2 First?

Feb 29, 2012

in Form1, I have this code

Dim FormTwo As New Form2
FormTwo.ShowDialog()
Close()[code].....

if I use Application.Exit, it will close all 3 forms.. But all I want to use is Close so that every time I show the Form2, it will close the Form1 first.. the same when I show the Form3, it will close the Form2 first.

View 1 Replies

Show Records From In Form2 According To Textbox.text In Form 1?

Mar 12, 2009

I am a rookie in VB and have been trying to show in form2 only the records in table2 filtered by the value of a textbox shown in form1 which is a value from table1.So far I have not been able to achieve this and I have seen so many answers to similar questions but when I try there is always something wrong.

View 2 Replies

VS 2008 Close Current Form And Show Different Form?

Sep 4, 2009

When I use

Me.Close()
Form1.Show()
It closes the whole app.

How would I change it so that it only closes the current form while opening a new one? EDIT: I put [Not Resolved] Because I accidently pressed the resolved thing

View 8 Replies

Create A Checkbox In Form2 That Says If Checkbox 1 Is Checked Then Show Picture 1 In Form 1?

Apr 15, 2011

I have a question, I can't really find the answer...Basically I have 2 FormsIn form number 1 I have 2 pictureboxes. I want to create a checkbox in form2 that says if checkbox 1 is checked then show picture 1 in form 1

View 1 Replies

Show A Message Box When A User Close The Form

Aug 12, 2010

I am trying to show a message box when a user clicks the red cross in the top right hand corner of the screen (to close the current form) and I want to code the OK and Cancel buttons so that when the user clicks OK butto the form closes. This is what I have

[Code]...

View 4 Replies

Show Close Button On A Borderless Form

Sep 14, 2011

I have the need to have a close button on a borderless form but I'm unable to find a way to display the win7 close button this way? Is it avalible in any way? (I dont wan't to do it the ugly, ugly, ugly way, IE do a screenshot and use that as a bitmap on a button)

View 9 Replies

Form Close With Time?

Aug 10, 2009

when i click button (button set for open new form)new form autometicly hide after 5 sec?

View 8 Replies

VS 2005 Show() - Hide() And Close() Form Several Times?

Jul 16, 2009

[Code]....

here i am dealing with only two form,so if i add form1.close() in the form2 button click event then it might wok. but what if i deal with many forms and i need to show and hide them several times?

View 2 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

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

VB 2008 Close Form1 Load Form2?

Sep 19, 2009

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Form2.Show()
Me.Close()
End Sub

i have this code on my MDI parent and on button click i would like Parent to close and form2 to load/show.yet with current code when i click button it closes all the app and doesnt load from2

View 3 Replies

Interface And Graphics :: Hide / Show - Doesn't Dispose When Close Form

Oct 23, 2008

Is there a way to have a form within a program that doesn't dispose when you close it? I have a form in my project and a menu item to show it. When I declare the form globally and show in menuItem.click, then the click event breaks because the form no longer exists. When I declare the form within menuItem.click, then this creates a new form every time I click and that's not what I want.

View 1 Replies

VS 2010 How To Prevent Fields Being Reset In Form1 & Form2 On Program Close

Nov 18, 2011

I am Matthew and I'm extremely new to coding and any sort of scripting language; yet I am highly interested in programming and want to learn lots about this subject. So to start myself off I am trying to create some applications which I could use in day-to-day life to just basically make life easier.So the first program I am trying to make I am already confused and not sure what the heck I have to do in order to get it functioning, I've looked on lots of videos on you tube for tutorials and they have all done a great job but some videos just don't answer my questions.When I click a button and "Form2.Show()" appears, how can I make it so that when I type text in a list box in form2, it doesn't disappear when I close it? Then once I have known done that, how can I make it so I can choose a random string of text in the list box on form2 to show up on the click of a button on form1? Then a final question is, How do I prevent fields being reset in form1 & form2 on program close? Also, is it ok for me to make a thread asking 1 simple question? or do I have to ask a handful each time to save threads or something?

View 30 Replies

Form2.show End Up Behind Form1?

Apr 1, 2012

I made 2 form.

In form1 I have this:

form2.show()
form2 ends up behind form1, how can I make form2 appear in front of form1?

Form2.showdialog() will make form1 disappear until form2 is closed, that is not what I want.

View 11 Replies

Link Up A Button To Show Form2?

Feb 12, 2011

I have two forms on my project and I want to be able to click a button and have the other form appear and show a picture in a picture box.

View 1 Replies

How To Make Only One Windows Form Show At A Time

Feb 16, 2012

i have a combobox that has 3 cases. case "0" opens a dialog saying, "Not a valid choice"but case "1" and case"2" open up there own separate forms. (FormMain and Form3)How do i make it so if Form3 is open FormMain Can not be opened, And a messagebox appear saying so. I do not just want the ".hide" function. I already have that set.I have tried a few differant things, none of which worked. And i tried them in the formload and in the combobox selected index

View 3 Replies

Show Form Once Not Other Time When Click A Button

Sep 7, 2011

I want when I click a button , it show form2 but if i click it again , it don't show form2...

View 1 Replies

.net - How To Show A Form's Custom Property At Design Time

Oct 22, 2010

I have a form where I have created a custom property, DataEntryRole, and set its Browsable attribute to True, as shown:

<Browsable(True)> _
Public Property DataEntryRole() As UserRole.PossibleRoles
Get
Return mDataEntryRole
End Get

[Code]...

When I view the designer for my form, DataEntryRole doesn't appear in the property box. I assume that it should appear if I were to create another form that inherited from this base form, but that's not what I want. I want this property to show up in my current form.

View 2 Replies

Make A Form Show When A User Uses My Application For First Time?

Apr 10, 2011

How do i make a form show when a user uses my application for the first time and only shows that time.

View 4 Replies

Make Column Not Show Every Time Form Loads?

Jan 2, 2012

The first column in my Data Grid is actually not my first column. It has an arrow pointed to the first row and then the last row has an asterisk by it. Is there anyway to make this column not show every time my form loads?

View 1 Replies

VS 2008 Show Restart Form After Idle Time

Dec 28, 2009

My main form has a timer that monitors idle time in my app: no mouse movements and no clicks.If the idle time reached 3 seconds, in *this example below*, then I want to show frmRestart, which will call the UnloadAllFormsExcept(Me) function from frmMain.When three idle seconds are reached, frmRepeat starts to show on the screen but never does!! I just see the border of the form and nothing else. My mouse goes into "thinking" mode forever.[code]

View 5 Replies

Form1 Has A Button On Click That Opens Form2 As A Show Dialog?

Jun 19, 2009

MDIform contains Form1. Form1's MDIParent is set to MDIform Form1 has a button on click that opens Form2 as a show dialog. I need this Action.Form2 has another button that opens Form3.Is there anyway that I can make Form3's mdiparent the original MDIform by passing Form1.mdiparent value to form2 (without actually setting that value) that then passes it to form3?

[Code]...

View 9 Replies

VS 2008 : Load Form1 And Form2 At The Same Time?

Jun 21, 2012

What im trying to do is load form1 and form2 at the same time.I have a setting called hideform2.So when i run both forms at the start up i want to get it so when they click on a close button and form 2 hides.I want it so when they run the application again it dosent show form2 anymore?

View 5 Replies

[2008] Pause To Give Form Time To Show Before Executing Routine?

Feb 10, 2009

Is there a command in vb that can be used to pause a routine to give time for the form to show before the routine starts as my routine is running and completing before my form shows up?

View 13 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 :: Navigate From Form1 To Form2. And Then Close Form1?

Feb 16, 2009

I have got 2 forms ----- form1 and form2

i wanted to navigate from form1 to form2. and then close form1

i did the following code.

-sub form1 _ page load
dim form as new form2
form.show()
me.close
-end sub

i also tried -- form1.close() and form1.dispose() but all in vain

Problem is that my form1 is not getting closed

View 7 Replies

[2008] Notify Icon When The User Clicks The Close Button That It Doesn't Close The Form?

Jan 17, 2009

I have set up a notify icon for my form. I want to make it so that when the user clicks the close button that it doesn't close the form it just takes it to shows the notify icon. They can exit the program from the notify icon. Can someone tell me how to keep it running?

View 2 Replies

Pass Data From Form2 To Form1 When Form2 Is Closing

Nov 29, 2009

Last one day I could not manage to pass data from one form2 other form.

When I am opening Form2 from Form1, I can pass data from Form1 to Form2.

When I am closing Form2, I want to pass data from Form2 to Form1 which is still open when I close form2.

I try to use shared textbox, but I understand that this is nt supported.

View 11 Replies







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