Forms :: Form Variable Value Blank / Null When Move From Form1 To Form2 And Back To Form1

Oct 27, 2009

In my window application, Form1 variable eg. Public str as string. value blank/null when move to Form2 and Back to Form1. How to maintain Form1 varable's value when back to Form1 In vb.net if any one know, reply me soon

View 2 Replies


ADVERTISEMENT

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

Exchagning Parameters - Able To Start With Form1, Move To LoginForm, Then Back To Form1 Taking 2 Variables And The "values"

Apr 8, 2010

I need to be able to start with Form1, move to LoginForm, then back to Form1 taking 2 variables and the "values" they have in the LoginForm back to Form1 and using the variables. I start with the main form (Form1) and have the user enter some information. Once they click OK I have the LoginForm open. After they enter their credentials I will check to make sure they are legal users, then go back to Form1 (here is where I need to take the Username and Password with me) to log onto a server using the same credentails from the login form.

View 1 Replies

Move A Panel With Textboxes From Form1 To Form2?

Jun 16, 2010

I have setup a small app to track company info and purchases, etc. I decided to move a panel with textboxes from Form1 to Form2. I did not move any code and after some thinking on it, I decided to move the panel back to form1 and continue with my original plan. Trouble came when I tried to run the app. The ide displays it perfectly but none of my code is working. Here is what I noticed ...

My original code from a textbox ...

Code:
Private Sub TxtCompany_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs)
If TxtCompany.Text <> "" Then
TempCompany = TxtCompany.Text
TxtCompany.Text = ""
End If
End Sub

This used to work before I moved the panel. I went back to txtCompany's events and doubleclicked "got focus" to start a new event to see if it was the same as what I already had. It displayed this ...

Code:
Private Sub TxtCompany_GotFocus1(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtCompany.GotFocus
End Sub

It's like I somehow created a dup of panel and lost it's original status and now the ide wants me to make a copy of the code. How do I get the ide to see the panel and it's contents as the original?

View 14 Replies

Move Or Save Text From Form1 To Form2?

Dec 8, 2010

I don't know how to move or save text from form1 to form2, text in form1 is in textbox and move or save it to label in form2.

View 10 Replies

Send A Variable From Form1 To Form2?

Jul 28, 2009

I have looked around and I can not find what I am looking for. I would like to send a variable from Form1 to Form2. I have found out how to send I text box from form1 to form2

How can I send a var from From1 to From2?

View 2 Replies

Pull The Variable AlarmMsgBoxName From Form1 Into Form2?

Jul 1, 2010

I have a string variable in Form1 called 'AlarmMsgBoxName'which is inside a private sub called 'Timer1_Tick'. And I have a label in Form2 called'AlarmName'.
What I want is 'AlarmName.Text' to equal the string of AlarmMsgBoxName.How can I pull the variable AlarmMsgBoxName from Form1 into Form2?

View 3 Replies

.net - Pass A String Variable Data From Form2 To Form1?

Nov 17, 2010

It's a program that reads student data from a text file and displys it in a listbox(Form1). From there on you can add a new student to the textfile by clicking on "Add" button that shows another form(Form2) and you input the new student data into the appropriate text boxes. Afterwards you can press "Add" button(Form2), but the Add Student(Form2) window comes up again with all the inputted data gone, and if I place the new student info into the text boxes again and click "Add", the program jumps back to the Form1 and a message box suppose to say what was added to the textfile, but nothing was added except for empty listbox items.

View 3 Replies

VS 2008 Passing Variable From Form1 To Form3 Via Form2?

Jan 10, 2010

IThere's a button on the toolstip that's always enabled for form2 so they are always able to search the database.When a user is on form1 and selects the link button. They are taken to form2 to select criteria to search. On Form3 they choose 1 item in the grid andcan select the Link It button on the form to link the 2 selected grid items (form1 and form3). Since form2 and form3 are available at anytime.my problem is knowing when the Link button on form1 has been chosen and after a successful link to not allow anymore links. Technically, they could pull form2 up via the toolstrip or an existing form2 window and Link as long as Form1 is on the screen but I do not want this. It's as though I need a global variable to set to True/False.

View 1 Replies

Display Same Button(button1) In Two Different Forms(form1 And Form2)?

Dec 22, 2011

Suppose, i have a button(button1)in form1.

Now i have opened a new form.

I want to display the same button(button1) from form1 to form2.

View 2 Replies

Forms - Reffer To An Object In Form1 With Code In Form2

Mar 5, 2009

If I create a new form, say Form2, in order to use it in a program I must create an instance of it: Dim frmTwo and new Form2, If Form2 has a text box on it I can put this code in Form1: [Code] But what happens if I want to refer to an object (a text box)in Form1 with code in frmTwo? This doesn't work: [Code] How is the instance of Form1 created? And How do I refer to it?

View 3 Replies

Forms :: Pass The Task_ID Of Selected Item From Form1 To Form2?

May 20, 2009

I had two forms, first forms shows all the task details in a list and user select any task and the second form shows the details of that task in edit mode so user can edit the record, now i don't know how to pass the Task_ID of selected item from form1 to form2.

View 1 Replies

Forms :: Stop The Sound In Form1 From Playing When Form2 Open?

May 30, 2009

im trying to open another form2/app that have music but i wanna stop the sound in form1 from playing when form2 open?

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

Call Form2 From Form1 In Wpf

Sep 18, 2011

if in vb.net, I can call like this form2.show (), but how in wpf vb.net?

View 1 Replies

Changing Form1 From Form2

Oct 22, 2008

I am having problems making changes to form1 from form2..I tried declaring form1 on form2 Dim f1 as form1.[code]I can change form2 from form1 but not the reverse.

View 5 Replies

Form1 Related To Form2?

Nov 21, 2011

this looks like to the forum I need. I have a question on somethings. My data is pulled from a local SQL sever express. First, Form1(Customer) has has data. his customer has a vehicle in another form this form is called (Vehicle) form.I have created the customer form in a detailed form and the vehicle form on a grid design.

View 1 Replies

Form1 To Open Form2?

Mar 27, 2009

I have been converting my VB6 programmes to VB 2008, and I am beginning to regret it.According to the books that I am reading on the subject, I can call a second form from the first one. That is, when the first form code has completed, and the final line reads:

frmForm2.Show()

the second form should open and wait for input.This does not happen, the form flashes and then disappears without allowing any input, or button click.I must admit that I preferred being able to start from a module, with a Main() sub, which then read the forms, a la VB6. everything seemed to work fine then.

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

IDE :: Transfer Form1 Val To Form2 ?

Jun 29, 2009

There is no session in desktop app in vb.net .i want to transfer valuse from one form to other want to transfer form 1 (TextBox1.Text) value on form2 (objuserpage.Label1.Text)

'form 1=userpage.vb
Dim objuserpage As New userpage()
' form 1 textbox TextBox1.Text[code].....

View 2 Replies

Panel To Form2 On Form1?

Mar 25, 2011

I have a panel to form2 on my form1 which displays a picture box fine. I got a peice of code that stores 5 images in an image list and works off a keypress.

When I press the Comma key the image changes to the next one. This works fine on its own but when I put it in form2 and try to put the keypress code on form1 for it to change image in the panel it doesn't work.

View 4 Replies

Set A Picture From Form1 To Form2?

Mar 11, 2010

I would like to do 2 things (or one of the two)

first, I have in form1 a textbox1 and i would like to bring the info of it to a textbox (or label) in form2

second, If it's possible i would like to set a picture from form1 to form2 (if that's possible)

View 2 Replies

Set Value Of Datagridview In FORM2 From Value In FORM1?

Jun 11, 2011

In the FORM1, the datagridview contain some product column and user can input the number of product quantities they want to buy.if user press the "buy" button, i want it to open FORM2, with datagridview containing the list of the product they buy from datagridview in FORM1.[code]...

View 1 Replies

Using Variables From Form1.vb To Form2.vb?

Apr 29, 2010

I have an equation on Form1.vb that calculates a number. I need that number to be used in another separate formula that's on Form2.vb. How do I do this? I thought using a Module would work but I can't get the function on the Module to "see" the formula and/or variables that I need on Form1.vb. I am using VB 2005.

View 8 Replies

Inter-Program Variables - If A Variable In Form1 Is "True" Than, How Can Make A Variable In Form2 Turns To "True" Too?

Feb 11, 2012

I know that

Public Incognito As Boolean

is a variable called "Incognito" that is class-wide that is a boolean.My question is that is there a form-wide variable form that can like communicate with different forms. So if a variable in form1 is "True" than, how can you make a variable in form2 turns to "True" too?

View 1 Replies

How To Force Form Load Event On Form2 From Click Event On Form1

Nov 16, 2010

I'm trying to execute different code depending on the button clicked (button 4 or 5) on Form1, but when I click on button5 to activitae the code on the Form2's Load event everything is Ok, but when I click the back button to return to Form 1 and click on the Button4 to activate the code on the Form2's Load event again, it doesn't active the Form's Load event, is there a way to form the form load event every time I access it from Form1? [code]

View 7 Replies

Call Menu From Form2 To Form1 Like VB 6 Do "Me.PopupMenu Form2.mymenu"?

Dec 15, 2009

I have 2 forms. On form1 i have listview on form2 i have menu. I'd like to call form2 menu from Form1 ListView1_MouseUp. I tryed to use this code

[Code]...

View 3 Replies

.net Login In Form1 Then Form2 Will Welcome The User?

Apr 15, 2012

i have here a login in form1 that is connected to my sql database.i want that if i login in form1. the form2 will show my name.

View 11 Replies

Accessing Listview1 In Form1 From Form2?

May 22, 2009

I need to have access to the Listview1 in form1 from form2, something like this:

Form1.Listview1.Items....

View 19 Replies

C# - Copy A Textbox Value From Form1 To Form2?

Aug 2, 2010

I have Form1 that has a textbox and a button. When user clicks the button in Form1, Form2 opens up with a label control that carries the value of textbox in Form1.

What i did is set the textbox modifier of Form1 to Public, but when i call the textbox name of Form1 in Form2, i get an error that says "The name "txtbx1" doesn't exist in the current context". I wonder why since i already set the modifier of txtbx1 to Public.

Quick Note: i tried to instantiate Form1 in Form2 as:

Form1 f1 = new Form1();

and then call

f1.txtbx1.text

The odd thing is Form1 could not be instantiated (not highlighting occurs). On the other hand if i do Form2 f2 = new Form2(); Form2 gets highlighted!

This is how i show Form2 from Form1:

SetSalary salForm = new SetSalary();
salForm.ShowDialog();

Note that SetSalary represents Form2.

View 5 Replies







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