Creating A New Form On A Old Form , Then Hide & Show Them?

Dec 5, 2010

I have two forms , and I want write a code like ( form2.show=true & form1.show.false)

View 2 Replies


ADVERTISEMENT

Hide/Show Items - Possible To Hide A Group Of Text Boxes From View In A Form

May 5, 2012

I'm curious if it is possible to hide a group of text boxes from view in a form until a particular condition is met, and to have a custom set of text boxes for that condition. To give an example; I want radio buttons offering choices for a manner of searching records, the user selects one and then a specific set of text boxes are displayed for the user to utilize, if a different option is chosen a different set of text boxes will be shown. Is this something that can be done?

View 7 Replies

VS 2008 Form Show Form Hide?

Sep 28, 2009

Private Sub HideShowTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()

[code].....

View 1 Replies

Hide And Show A Form Which Is Owned?

Apr 12, 2010

I have a form called form1 when i press button1 i open a new form [code]..

now this new form is owned by Form1 so that i cant use form1 till the new form is closed.[code]...

View 8 Replies

Show / Hide Form When Cursor Is In The Top Left Corner?

Jul 13, 2009

you know how you can set the windows taskbar to appear and disappear when the position of the mouse is all the way at the bottom? i want to do the same thing with my form when the mouse is in the top left corner of screen.or perhaps you can suggest to me a different way to do this. the user will probably just need to set those trackbars just several times during their usage.

View 1 Replies

User Controls Hide And Show In Main Form

Feb 8, 2012

I have a couple of user controls, which I show in my main form.

So let's say here's what i want:
Sub Show_Control1()
UserControl1.Show
'CODE TO HIDE EVERY OTHER DISPLAYED USER CONTROL ON THE MAIN FORM
End sub

Right now I have to hide them one by one with hide, because I don't know what's the current displayed form.

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

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

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

Forms :: Process MainWindowHandle - Simple GUI Form To Hide / Show / Minimize / Terminate / Force Terminate

Sep 11, 2011

I have a simple GUI form to hide / show / minimize / terminate / force terminate Processes. i can do all well but for show and hide i need the MainWindowHandle to show or hide it

So here is hide process code:

Dim Proc As New Process = Process.GetProcessesById(List.SelectedRows(0).Cells(1))
Dim hwnd = Proc.MainWindowHandle
ShowWindow(hwnd,0)

If i try the same with show code:

Dim Proc As New Process = Process.GetProcessesById(List.SelectedRows(0).Cells(1))
Dim hwnd = Proc.MainWindowHandle
ShowWindow(hwnd,9)

The MainWindowHandle become 0 cuz its hidden is there is any other way to get the MainWindowHandle of Process ?

View 6 Replies

VS 2008 - Mdi Form - Startup Form For My Program - Hide The Treeview

Jul 2, 2009

I am using vb.net 2008 i have been using a mdi form which is the startup form for my prog. and i have a main menu on that form. now i would like to shift to tree view as my client has asked for it. whenever a node is selected i can select the form corresponding for that particular code. everything is fine till here. but when the form is loaded the tree view is coming on top of the form the tree view is docked in a pannel. now i have tried everything treemenu.sendtoback and the say the form to b called is taxtypemaster then taxtypemaster.bringtofront but still the tree view is coming over the form

I have tried the following :

Dim mMenuSelected As String = e.Node.Name
Select Case e.Node.Name

[CODE]...

Even the visible doesnt work as it seems after the .show it makes the tree view visible again. how do i hide the treeview pls. someone guide me at the earliest. i feel it is not the prob. of treeview but something to do with the mdi form am i right ?

View 23 Replies

Hiding The Child Form Also Hide The Parent Form?

Aug 16, 2010

I have three forms: A, B and C. Upon a button being clicked, A displays B. Similarly, B displays C. Both using the ShowDialog() method.

However when I use the Hide() method (inside a Button Click event) on form C to close it, form B also closes. Why would this be? As far as I can see, it shouldn't be doing this. I certainly didn't write any code to tell it to do that.

[Code]...

UPDATE: I am an idiot. DialogResult was set to Cancel on the button as I'd copy+pasted it from the existing Close button and not realised that property was set

View 3 Replies

Mdi Form And Show Form - Error "Form That Is Already Visible Cannot Be Displayed As A Modal Dialog Box"

Jan 26, 2010

I'm new in .Net and I have an application with windows form "LOGIN" When users enter the user and password and click "ok", then if user passes validation then I have the code Show(MDIMainMenu) (I'm trying to open an mdi form), but I receive the following error: "Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling Show. Error Number 5"

[Code]...

View 2 Replies

VS 2008 Creating A "Show Once" Form?

Oct 5, 2009

I'm trying to create a User Agreement window that has the ability for the user to choose to not show the window on the next program start up.

View 1 Replies

Run My Form It Says: An Error Occurred Creating The Form. See Exception.InnerException For Details?

Jan 5, 2010

when i try to run my form it says:An error occurred creating the form. See Exception.InnerException for details.The error is: Cannot create ActiveX component

View 5 Replies

Creating A Link From The Control In One Form To The Entire Nother Form?

Apr 12, 2009

I have another question (and anticipate that I will have about two more before I'm done with my class project). Here is my issue (and I'll copy and paste my code for clarification). I need to link up the control from the form on either side of the current form that I'm working on so that if I click on the buttons that I'm titling previous and next that I can click on the proper button and either go directly to the previous form or the next form. I was successful in doing this for two earlier forms on this project (with some direction from a couple of helpful people on this forum before), but for some reason, no matter what I details I use the controls do not connect to the previous and next forms.

Option Explicit On
Option Strict On
Option Infer Off

[code]....

View 4 Replies

Multiple Forms - Declare And Instantiate Second Form On Program Start - Use Button Simply To Show Form?

Jan 14, 2010

I have a program that uses two forms. The program opens to the Main form, and the user can navigate to the other form from the Main form through use of a button. Here's the way I've currently written it: When the Main form loads, it declares and instantiates the other form during the load procedure. When the user presses a button, the second form is displayed by means of the ShowDialog method. On the second form, there is a Return to Main Screen button which closes the second form, bringing the user back to the Main form.

So, here's the structure of the code:

Code:
Public Class frmMainForm

Dim frmSecondForm As New SecondForm

Private Sub btnSecondForm_Click(blah, blah, blah) Handles blah, blah, blah

[CODE]...

Here's my reasoning: Originally, I wrote the code so that a new instance of the second form was created every time the button was pressed. The problem was that whatever data was displayed on the second form, previously, was lost when the user returned to it a second time. Since the user would be switching back and forth between these forms, frequently, I needed that data to persist.

What is the best practice for accomplishing this:

1) Declare and instantiate the second form on program start, as I have done, and use the button simply to show the form?

2) Declare and instantiate the second form each time the button is pressed but maintain the variables on the Main form and pass them ByRef to a custom constructor for the second form? Is this even possible?

3) Something else?

View 5 Replies

Create A Stopwatch In One Form And Another Form Show My Progress Bar Using A Combo Box

Nov 11, 2011

Im trying to create a stopwatch in one form and another form show my progress bar using a combo box for mins and seconds to show the progress bar on form1 1

[Code]...

View 2 Replies

Use A Progressbar To Show On Main Form And Then Finish When Next Form Is Loaded

May 12, 2009

I am trying to use a progressbar to show on main form and then finish when next form is loaded, I have got this code.

1. When I click on button, it must open next form, but the next form must only open when the data in my list box has been loaded from Access Databse. When I run my program, it only shows the progressbar and don't open the next form.

Main form code:

Public Class Main

Dim PB As ProgressBar

Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

[CODE]............................

View 4 Replies

.net - Open A Form With Form.Show First Mouse Click Is Ignored?

Nov 12, 2009

Using the code below:

Private Sub ShowDropDown()
Using f As New DropDownForm
f.Visible = True
Do While f.Visible
Application.DoEvents()

[Code]...

This was a guess, after looking at the Form.ShowDialog method in reflector.My question is, is there a managed call I can make to acheive the same result, and what does a button click do that other clicks don't?

ETA: The problem does not occur if I open the form using a key.

View 1 Replies

Form.show() Loosing Context In Originating Form?

Nov 8, 2011

This is a database app where I am trying to check for possible duplicates and give the user the option to keep the new record or assign to an existing record.In form1 the user will enter data into a textbox. I use this information to build a bindingsource.filter. Then I call another form (form2.show()) to display results to user and get user response. This part all works correctly.

The problem is that as soon as form2.show() executes, I loose the contents of the textbox - and it appears that I am no longer in the bindingsource.addnew() method.

View 14 Replies

Show A Particular Form For Every Button The Form Is Opened In A New Window

Mar 5, 2009

Iam creating an application. i have a main form it has 5 buttons i have created 5 more forms. my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be embed in the main form when i click anthor button it will show the related form in place of previous form

View 2 Replies

Show A Particular Form For Every Button The Form Is Opened In A New Window?

Mar 5, 2009

Iam creating an application.i have a main form it has 5 buttons i have created 5 more forms.my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be embed in the main form when i click anthor button it will show the related form in place of previous form?

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

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

Show Another Form And Unload The Current Form ?

Oct 14, 2009

i used to write the code to show another form and unload the current form it always told error on UNLOAD form2.show unload me Do i have to use the code :

.Dispose()

or is there another suggestions

View 2 Replies

Form.Show From Another Thread Hanging Form

Jul 25, 2011

I have a series of methods being called for my networking code. An event gets fired from the networking thread. Inside this event, which I've hooked into from a singleton class, I route messages to form level methods which they register on form load to handle certain messages they care about. Inside of these form message hooks I need to close the current form (which I was able to do) but also show a different one (which is giving me the trouble).

[Code]...

View 1 Replies

Show Info Form Exel To Abv.net Form?

Jun 11, 2011

I want to use a form in vb.net 2010, so when I click on a button ,it must show me the info of a specific row in Exel and display info of that row in a text box.

eg.
Name Surname phone
Koos Leeds 08212122392

How do I start with this, any samples.

View 1 Replies

VS 2008 : Why Instantiate A Form Instead Of Form.show

Dec 18, 2009

why I need to instantiate a form instead of form.show?

View 20 Replies

VS 2008 Form.Show / Form.WindowState?

Oct 26, 2010

I have a dual monitor setup on my computer. My program has multiple forms. I've designed the program to check which monitor the main form is currently on and to open the secondary forms on the current monitor. When the main form is on the primary monitor the secondary forms open as FormWindowState.Normal which is the design-time setting for the secondary forms. If the main form is on the secondary monitor and I click to open a secondary form then the secondary form is to be displayed as FormWindowState.Maximised.

[Code]...

So I moved the Form.Show line to after the Form.WindowState line. This works fine when the Form.Show process is very quick. The problem is that one of the secondary forms downloads some information from the internet so it takes about a second to finish the Form_Load process. When I had Form.Show first the form would not appear on screen until the Form_Load process is complete, so the delay was in the form appearing at all which is how I prefer it. With Form.Show last the form appears on screen immediately but appears mostly blank and unresponsive until the Form_Load process completes.

I would prefer that the form not appear at all until the Form_Load process is complete but I would like it to appear in an already Maximised state. Is this achieveable? It doesn't seem that complicated but I just can't figure it out.

View 10 Replies







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