Passing Info Between Two Forms

May 20, 2011

I have two forms named are form1 and form2 (form1.h / form2.h)There are a textbox and a button on form1 and form2.When I clicked the button on form1, it must fill the textbox on form2 and when I clicked the button on form2, it must fill the textbox on form1 how can I do it,when I define #include "Form2.h" in form1.h AND #include "Form1.h" in form2.h, it gets me an error "error C2065: undeclared identifier.

View 3 Replies


ADVERTISEMENT

VS 2008 Passing Info From Textboxes In Different Forms?

Jun 13, 2011

Im looking to pass information from a number of textboxes in one form to a number of textboxes in another form using Visual Basic 2008.

View 2 Replies

Passing Info From One Form To Another?

Mar 4, 2012

I am having trouble passing my summary info from my main form to the summary form. Only thing I have been able to have it do is show me the OK button to exit the program which is essentially no progress

View 11 Replies

Passing Info To Variables

Apr 21, 2011

I have a program that I am writing that asks the user for information.The program takes that info and passes the strings to a module that has a set of case statements for comparison.The program was working just fine yesterday, and now it acts like there is no information being passed to the module for comparison.[code]

View 2 Replies

Passing Class Info By Value Rather Than By Reference

Apr 30, 2010

Public Class Form1
Public Contestant As New ContestantClass
Public HighScore1 As New ContestantClass
Public HighScore2 As New ContestantClass
Public HighScore3 As New ContestantClass
[Code] .....

The problem I'm having is the first time I take a value, it gets inserted in the right section. The second time I insert a value, it inserts it in the correct place AND updates the previous value I inserted with the new value. So apparently when I'm doing:
HighScore1 = Contestant
It's pointing contestant AT highscore1 rather than taking the name, company, and score from contestant and then storing it in highscore1. How I can pass that info by value rather than by reference?

View 3 Replies

VS 2008 Enum And Radio Boxes-passing Info To Business Class?

Jan 29, 2011

I'm trying to pass data from the main form to a business class form for calculation.I have 3 types of cars and I can't get the code right to pass that to the business form. It seems correct to me, but obviously, it's not.This is the code for the calculate button, I can't figure out why its telling me that CarSize is not a member of the business form when I have it in the Enum statement at the top. I'm going by what the book says and this appears right according to it.

Dim CarTypeInteger As Integer
'determine the car size from radio buttons
If LuxuryRadioButton.Checked Then

[code]....

In the book it says to specify the class name when declaring the enum on the business form. So to me it looks like it should be -RentalRate.CarSize.Luxury The error I have is 'CarSize' is not a member of the 'ChristiansCarRentals.RentalRate'.

View 6 Replies

Passing Data Between Forms Without Any Public Methods Or Properties On The Forms

Dec 28, 2009

Passing data between forms without any public methods or properties on the forms. everything but the "Controller" class, which I would like you furnish. I just changed the title from "Intermediate" to "Beginner" This solution is an example of the Observer Pattern. The "Controller" class is the "observed" class, which in this case means it publishes events.

' File Definitions.vb

Public Delegate Sub MessageDelegate(ByVal sender As Object, ByVal e As MessageEventArgs)

Public Class MessageEventArgs : Inherits EventArgs
Public Message As String

[CODE]...

The program should initially display Form1, and Form2. Clicking of the button on either form will modify the Title Text of both forms. I think that you will find the final end result to be pretty neat, as it works with any number of open forms not just two. I think asking for the Controller class is easier than asking for the code in the forms. My solution for Controller class has 7 lines of content, 9 lines if you include Class, EndClass. A minimal solution could achieved with only 4 lines of content, but it would a textbook example of bad programming.

View 12 Replies

Forms :: Passing Several Textbox.text Between Forms

Jul 28, 2010

I use the code

Dim Selvk As New Selvkost2
Selvk.PassedText = TextBox29.Text
Selvk.Show()

[code]....

in my second form and the text passes. but I need to pass values from 20 textboxes. do I have to copy the code in my second form 20 times an declare passedtext2 and so on or is there an easier way to do this?

View 3 Replies

Forms :: Wonky Variable Passing In Forms

Apr 22, 2010

This is my first Windows app to create since VB6. I've been in the world of ASP and ASP.NET for many years. However, now I have been asked to create a simple app that needs to be windows based.

[Code]...

View 4 Replies

Forms :: MDI Forms And Passing Information

Dec 17, 2010

Example Form1 with data bound controls and a Public Variable Form1Var.Form2 with data bound controls and a Public Variable Form2Var DataTables are related Form2 Data is related to Form1 Data in a one-to-many.What I am trying to accomplish.When editing Form1 data there is a button to open Form2 if new data needs to be added. on closing Form2 I would like Form1 to remain at the state it was in before opening Form2. If I Change Visibility of Form1 when Form2 is opened upon Retun to Form1 Data is reloaded, if I minimise Form1 when Form2 is opened upon return to Form1 Public variables are reset to defaults.I have many Forms with many controls and buttons to do Lookups or additional add to related tables.

View 2 Replies

Forms :: Passing Data Between Forms?

Nov 12, 2009

I have a gridview on a form pulling user data. I have also created a basic login system where users login and their username/password is checked against a table in SQL Server 2005.The gridview is on Form 2 but i am having great difficulty in returning the records in the gridview for the user that is currently logged in.

View 3 Replies

Forms :: Passing Information Between Forms

Aug 21, 2011

I'm getting a little fustrated, ive been trying to figure out how to allow my main from access to a sub form. what I'm initially aiming for is control of text and font color via a dialog on the main form and the results to appear on the second form, if that makes sense. Most of my knowlege resides around using VB.net for creating games and not progams. ill post the code so you guys might be able to get a better understanding of what im looking for as a result.

[Code]...

View 2 Replies

Forms :: Passing Values Between Forms

Jul 23, 2009

My scenerio is a form with a button, when clicked opens a form dialog. The dialog allows the user to enter a text box. I want to read the value of the text box from the main form into a variable to be used with an SQL statement. The following code is used to create a new instance of the form dialog if one does not exist:-

[Code]...

View 2 Replies

Forms :: Passing Variables Between Forms

Nov 27, 2009

I seem to be running into an issue. This may seem like a noob question (which it really is, I only have experience in vb6 from years ago) but what Im trying to do is pass a variable from one form to another. Ive tried telling the first form to set the value of the variable on the second form like so frmsecond.variable = "value" but that does not work. Ive tried placing a public variable in a module to do it, but again, no luck. The only way seem to be able to get it to work is the second form setting the variable by reading the value from the first form like so [code]The problem I have with that code is what if for some reason the selected line gets changed as the form is loading or something to that nature. It doesnt seem very secure.

View 5 Replies

How To Transfer Info To Other Forms

Feb 22, 2011

I'm new to programming so go easy on me.. I am wondering if this is possible to, send info that the user typed into a textbox to another forms textbox. for example you type into a textbox on form 1, you click a button to take you to form two and it shows what you typed in as a rich textbox, a label or whatever works, and have it be able to change each time you type something in to the first textbox.

View 1 Replies

Forms :: Grabbing Info From A Listbox?

Feb 19, 2011

I've made a listbox and imported multiple paths into it (writing the app in VB.NET 2.0).For example:

C:Path1file1.txt
C:Path2file2.txt
C:Path3file3.txt (varies depending on what the user selects)

I need to be able to grab each path seperately without having to get the user to select a particular item so i can do a batch of all the paths selected.

View 6 Replies

Forms :: Capturing Info On Current Form?

Jun 15, 2009

have the following code, it works sometimes but other times when a form is minimized/Restored Down it will freeze, doesn't produce an actual error in VS but just freezes and does nothing..

The code captures a current form, the forms title, process id, a pixel color etc

Public Class Form1
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

[Code]......

View 1 Replies

Forms :: Grabbing Info From Listbox Into Textboxes?

Jun 2, 2009

i am currently working on a form that looks like this: When i click on any textboxes under Plan Code, the plan form will pop up. When i click on a field in lbType, field will appear in my lbCode. When i click on a field lbCode, i want to be able to insert information into the textboxes.

The problem i have is that i can only get the form to work for the first row of textboxes. Because my code looks like -

Private Sub lbcode_selectchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbCode.DoubleClick
addNewClientPolicy.TextBox1.Text = Me.lbCode.SelectedItem

[Code].....

View 3 Replies

VS 2010 Saving Info From Forms/Dialogs?

Feb 23, 2012

I am trying to get my project to be able to save the data been input from a user. I have uploaded a screen shot of the dialog I am currently trying to use. You will see that I have got a combobox for member at the top. What I want is when the "new" button gets clicked then I can add the desired information then click "Ok buttton which will then save the information.

I want to be able to select members from the combobox after multiple have been recorded to be able to delete or edit them. I have got as far as "changing" the combobox to a textbox for input purposes. I have tried a few attempts to get it. I am getting "ConfigurationErrorsException was unhandled"

View 2 Replies

Adding And Passing Value Between Forms

Apr 10, 2009

I am trying to do a really simple function (atleast it was simple in 6.0)... what I want to do is have two forms. One with a textbox, and one with a button and a textbox (we'll call this one form2). When I add a value to form2 and click the button I want the text to appear in form1's textbox.

My code in form2 is...
' on event button1_click...
form1.textbox1.text = me.textbox1.text
("me" being form2)
Anyways, how to pass a value from one form to another.

View 3 Replies

Asp.net - Passing Values Between Web Forms?

May 1, 2011

Im trying to pass a value of a date control from form1 to form2.on form 1.aspx.vb:

Public ReadOnly Property Property1() As Date
Get
Return StartDate.SelectedDate[code].....

Tried to assign the property to a string, it did not work either.

View 2 Replies

Passing Data Between Forms

May 10, 2010

I have 2 forms. Using Visual Basic.On Form 1 there is a populated combo box. This was done so by running a query through it and populating it with PUZ_ID values from a data set.On form two there is a tool strip and below is a search query.I need to be able to select the value i want in the combo box on form 1, and launch a button that opens form 2, which has loaded the data that i binded onto the form.Anyone have any ideas/code or need me to clear this up a bit more?So i need to run something through a query, or make something public or what?

View 2 Replies

Passing Data Between Forms?

May 10, 2010

I have 2 forms. Using Visual Studio.

On Form 1 there is a populated combo box. This was done so by running a query through it and populating it with PUZ_ID values from a data set.

On form two there is a tool strip and below is a search query.

I need to be able to select the value i want in the combo box on form 1, and launch a button that opens form 2, which has loaded the data that i binded onto the form.

So i need to run something through a query, or make something public or what?

View 2 Replies

Passing Objects Between Forms?

Aug 11, 2010

I'm translating a document management application from vb6. I want to program with good habits and technique, so I'm asking for your opinion really rather than just a solution.I have a decent understanding of OOP, but I'm not very experienced in VB at all. What I'm doing now is trying to figure out the best way to pass objects between forms.For example, in my initialization form, I have an object that stores a group of database connections. I need to pass this object around because reconnecting takes a significant amount of time. There are other objects such as user info and permissions.

Public Class Form 1
Dim DB = New DBobject
Public Sub Form1_Load

[code]......

View 5 Replies

Passing Parameters To Forms

Jul 2, 2010

I designed a form simply holding a combo box, button & Datagrid, working well when executed from another erp application.Now i would like to get parameters from the application and pass on to the form. The parameter has to replace the value of Combobox value.

View 3 Replies

Passing Values Between Forms

May 27, 2009

I think I'm getting hung up on syntax here. I've got 2 forms and am trying to pass a textbox value from the 1st form to the 2nd. The textbox value is an unique ID #, so it's an integer value in the database. The ID displays in the textbox just fine on the 1st form. When I try to access the value of this ID textbox in code in the 2nd form, I see that the value is empty, or equal to "". But I see a valid ID # on the 1st form. Here's the code that shows me that the textbox equals "".

[Code]...

View 2 Replies

Passing Values Between Forms In VB?

Jun 4, 2012

solid rundown of how this process works using custom events &EventArgs, Im really having trouble wrapping my head around it

View 14 Replies

Passing Var Multiple Forms

Jan 28, 2010

I have a "Open File" menu on form1 that reads the user input data from the selected file, stores them into variables, passes on the var. to my form2 and loads up my form2 with the user input data. My code works But when I close my form2 and button click form1 to open form2, I still see the same input data I want all my text boxes to be blank.

View 8 Replies

Passing Variable Between 2 Forms?

Jun 15, 2010

i have 2 forms -> form 1 and form 2

in form 1 -> 1 button
in form 2 -> 1 textbox and 1 button

when I click button in form 1, it will show the form 2..how can i pass the variable (data from textbox in form 2) into a variable in form 1 after clicking the button in form 2 ?

View 8 Replies

Passing Variables Between Forms?

May 17, 2012

I have a Form1, the user types a "Client ID" in a textbox if it's not a valid one, it opens a Form2 in which the user selects the correct "Client ID", once selected he presses an OK button. And there comes the porblem.. it opens a new Form1 with the Client ID that he selected from Form2, but I still have the first Form1 opened.
I have two Form1 opened...

I which to keep the original Form1, but with the value sent from Form2..

I'm using this code:

Code in Form1
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code].....

View 2 Replies







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