Display (show) The Same Form Multiple Times?

Oct 28, 2009

How can i display (show) the same form multiple times? Lets say Form2. This code only shows the form once: Form2.Show()

View 10 Replies


ADVERTISEMENT

Clicking On A Date Several Times And Have The Display Show Always?

Dec 16, 2010

clicking on a date several times and have the display show always

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

Call The Second Form Multiple Times?

Feb 29, 2012

I am doing a project for my company. In that i have to enter the number of items in the first form and in the second form i am going to enter the details of each items. So i have to repeat the second form to get the details number of times depending on the value i have given for number of items in the first form.From the home page i will be entering the values for the master file. after entering the values for the master file then i have to enter the details of the individual item details in a transaction file.

View 3 Replies

How To Display A Bitmap On Form, And Then Remove It At Times, And Put It Back Again

May 13, 2009

I want to display a bitmap on my form, and then remove it at times, and put it back again.
I have the Bitmap in my resources folder.in my form properties, it is selected as background image.

somewhere in my code I set the background image to = nothing (that makes it disappear) but every time I try to bring it back, I get file not found.I got it to display when I hard-coded the entire path and filename.[code..]

Obviously, when I publish and distribute to clients, the file won't be there.[code...]

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

Show Multiple Images On A Form?

May 24, 2009

Is there a simple way to show multiple images on a form?

(Somting like this?

-> Movie (American Gangster) = Picture 1
-> Movie (American Pie) = Picture 2

the data must be variable....

View 1 Replies

Show Same Form On Multiple Monitors?

Aug 13, 2010

I am creating a Jeopardy type game and I want to be able to have the same form show on multiple monitors at times and at other times show a form only on one monitor. I have no problem getting a form to show up on the second monitor, but when I try to show the same form on multiple monitors I run into problems.[code]...

View 3 Replies

Display/Focus/Show Form On Top Of PC Game?

May 4, 2011

What I am trying to accomplish is this: I want to be able to press the F5 key on my keyboard, while playing a PC game, to show (bring forward, focus, etc.) my program. My 3 attempts so far have failed. Any idea on how I could accomplish my goal? Similar posts on other forums say to set the form's key preview to true and use on keyPress... which failed.

View 1 Replies

Multiple DataAdapters - Changing One Dataset On A Form Cause All Of The Datasets To Show Changes?

Jul 12, 2010

I have a form with multiple DataSets (filled by multiple Stored Procedures) and corresponding DataAdapters. Associated with the DataApters are commands for UPDATE, INSERT......... Before using the DA Update I am using 'If DSxyz.HasChanges(). It seems that when I make a change anywhere on the form affecting 1 dataset, all of the datasets show this to be true. Why should changing one dataset on a form cause all of the datasets to show changes?

View 1 Replies

VS 2010 - MessageBox.show - Maintain Execution And Display Status On Second Window / Form

Dec 2, 2011

I've created a form with several controls to specify the inputs to my program. They include TextBox, OpenFileDialog, Button and even a user control for numeric input. When the user clicks the 'GO' button, the program begins it work. Opening several files and processing a bunch of numerical data. This could take many minutes/hours with large datasets.

What I've been trying to do is have another window/form open up and send status information to it for the user to view. The info to be displayed is varied and constantly updated as the program crunches the numbers. Many many programs do just this type of activity.

I attempted to create a second form with a huge TextBox thinking I'd just write stuff to it. I called the .show method within the .click of the 'GO' button and of course the form is displayed but control of the program's execution doesn't return until the form is closed. How to I maintain execution and have a second window/form to display status?

View 3 Replies

Show The Msgbox All The Times When The Combo Lostfocus

Mar 23, 2009

This is a code in event lostFocus:

[Code]....

The code shows the msgbox all the times when the combo lostfocus...

View 7 Replies

Run A Loop Multiple Times?

Sep 28, 2009

I read the lines from a textfile into a string array and then I use a foreach loop on the string array. I want to go through the same string array again after the loop reach the end of the string array

View 1 Replies

WebBrowser1_DocumentCompleted Multiple Times?

Jul 29, 2011

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

[Code]...

View 4 Replies

.net - Singleton Initialized Multiple Times

Jun 27, 2012

So I took this from an example. GetInstance() is called from hundred different places in my program, and when I debug, the line "Prog = New Program" keeps getting hit for each of those calls. Which I thought was exactly what should NOT happen.. Or do I have some fundamental misunderstanding?

[Code]....

It seems the "New" sub triggers a number of calls to Program.GetInstance, before the first one completes. This is due to me earlier having lots of shared public objects in this class, which are no longer shared since the class was made singleton. And these objects, when initialized, calls the Program class for reference to other of it's objects.

View 2 Replies

Add Textbox Value To Datatable Multiple Times?

Jan 23, 2011

Here is my [code]...

My textbox (txtCopies) default value is 1 so naturally, as it is coded above, the datarow is added once into the Movies Table. But what I need to know is how to code if the txtCopies field has a greater integer value.

View 6 Replies

Attribute Cannot Be Applied Multiple Times?

Mar 26, 2012

I keep on getting errors for every line in the code below that tell me that the attributes cannot be applied multiple times. What does this mean and how can I fix it without changing what the code does?

Imports System.Reflection
Imports System.Runtime.CompilerServices
<Assembly: AssemblyTitle("")>

[Code]....

View 2 Replies

How To Loop InputBox Multiple Times

Feb 24, 2012

I'm trying to loop the inputbox 5 times but I'm not sure how.
Dim payroll1 As String
payroll1 = InputBox("What is the payrolls for store1", "Inc", , , )
Lblstore1.Text = payroll1
I can get it to loop till a specific amount but not 5 times exactly.

View 9 Replies

How To Undo / Redo Multiple Times

Apr 20, 2009

i need this option for a textbox. the undo/redo in two separate buttons and it should be for multiple times not just once.[code]

View 21 Replies

Multithreading - Running One Sub Multiple Times At Once

Jul 17, 2011

I have one Private sub that runs in a loop. I want the sub to run multiple times at once. For example the program runs, you press start; you run the program again and press start, again and again... the same program doing the job at once. now i just want one program do to it alone. But i would like it to be user defined. exp. run program. type in a text box 10. press start. and it works as if 10 of them work open working on the same thing.

[Code]...

View 1 Replies

Open Program Multiple Times?

Nov 5, 2010

Is there any way that I can tell if a second version of the same program is opened by the user.

View 5 Replies

Reuse Code Multiple Times?

Nov 13, 2010

How can I tell something to use a code without completely adding it in that sub again? I have some code that will be used alot within my program. I could write a DLL, but I don't know how to use those!

Here is my code:

Dim str1 As String = System.IO.File.ReadAllText(Me.OpenFileDialog1.FileName)
Dim s2 As String = str1.Replace(".[1gs5]", "a")
s2 = s2.Replace(".[u775]", "b")
s2 = s2.Replace(".[fsef]", "c")

[Code]...

View 4 Replies

VS 2008 - Getting Data From DB Multiple Times

Nov 25, 2010

I have a button where I get data from a database that matches a search string I enter. Everything works fine the first time the button is clicked. However, if I click it again with a different search string, I get the same results as the original search string. I've tried to dispose, clear, and reset my dataset before I load the data each time, but it still finds the original query. This is the code I use to get and request the data:

Private Sub btnCfind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCfind.Click
mdbFile = "TCICUST.DBF"
mdbCond = " WHERE COMPANY LIKE '" & cbCust.Text & "%' ORDER BY COMPANY "
GetDB()
[Code] .....

View 11 Replies

Include The Reply Times In The Display?

Jun 17, 2007

i have the code below to ping an ip address, it works fine but Is there anyway i can include the reply times in the display or return the ping reply times in any shape or form for that matter ? preferable the average round trip time in ms is what i would like returned along with the ping result. anyone have any ideas or is it even possible to do within vb ?

[code]...

View 8 Replies

EditingControlShowing Events Firing Multiple Times?

Feb 24, 2009

I have a DGV in VB.Net 2008 connected to an Access DB table. The DGV is not Read Only, but is full of read-only columns except for one, which contains a combo box. The combo box allows the user to select an outcome for that particular row, and then the program copies in a pre calculated value into the "Profit" column depending upon the item selected in the combobox. Then the user hits the Save button and the DB updates (currently via SQL methods in the XSD).

Easy enough so far.

Here is the code.

Private Sub DGUserBets_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DGUserBets.EditingControlShowing

[Code]....

The problem I have is that it would seem that if a user selects the desired outcome from the combobox but does NOT hit Enter, and simply mouses on to a different combobox to again select the outcome for a different row, the first eventhandler is not disconnected and thus the events fire multiple times. This then causes various default MsgBox errors and brings up problems when the user tries to commit all changes to the DB/exit program etc etc.

What do I need to do? Do I need to .EndEdit somewhere appropriate to force the row to save the changes? And where should I call this?

View 5 Replies

Events - SelectedIndexChanged Firing Multiple Times

Apr 25, 2012

I am trying to programmatically add an unspecified amount of new UserControls to a form. One will be added every time an entry is selected in a ComboBox contained within the UserControl. Problem is, the SelectedIndexChanged event fires completely erratically. Sometimes twice, sometimes 3 times, etc., but never just once. No matter how many times I set the combobox's SelectedIndex to -1, it fires at least once with a SelectedIndex of 0. Sometimes the Itemselected event fires multiple times inbetween SelectedIndexChanged events.

InvoiceEntry.vb snippet:
Public Event ItemSelected As EventHandler
Private Sub cboItem_SelectedIndexChanged(sender As System.Object, _
e As System.EventArgs) Handles cboItem.SelectedIndexChanged
RaiseEvent ItemSelected(Me, EventArgs.Empty)
End Sub
[Code] .....

View 1 Replies

Multiple Forms With MenuStrip Can The Same Menu Be Used Several Times?

Aug 15, 2011

I have a number of forms which have a common menu strip rather than copy the control onto each additional form is it possible to just call the menu from another form ?

View 3 Replies

Populating The Data-grid Multiple Times

Aug 23, 2010

I want to search data and then populate on a datagrid. I write the name and I click the button and it does work well, but then if I want to search for another name, I write the new name and when I click the button again the datagrid comes empty. No data at all. I will put my code'[code...]

View 4 Replies

Running Same Report Multiple Times With Same Query?

Sep 5, 2011

I have a report that displays some sales info. I have a query that takes the data from an SQL Server database and I store it in a dataset. Up to there everything is ok. The problem is that I need to print the same report using Crystal Reports for each row in my query. Is there any way this can be done? I call a form with a ReportViewer tool to display the reports, wich are basic .rdlc reports.

View 1 Replies

Saving Code To Reference Multiple Times?

Jan 10, 2011

I have a block of code which is used to save some information to a text file. I need to use this a few different times in my app.I could just copy and paste it each time but that seems messy and is adding unnecessary code. I'm sure I can just save the code once and reference it when I need to. I think it's done in either a module or a class or something

View 8 Replies







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