How do i send data from one form to another?

shizuka

Member
Joined
Jul 26, 2006
Messages
7
Programming Experience
Beginner
What I have to do is on one form, ask the user to select a language then i have to change the language settings on the main form.. How do i go about doing this in without calling out the form?? Thx in advance!!!
 
Follow the first link in my signature and read all four parts. After that you'll know how to affect any form from any other form. Setting any property or calling any method is exactly the same principle.
 
Are you talking about form1.label1.text="english" - if you write that line in your code on form 2 it will change that text in label1 on form one

Thorst
 
What I have to do is on one form, ask the user to select a language then i have to change the language settings on the main form.. How do i go about doing this in without calling out the form?? Thx in advance!!!

Are you inquiring about WEB forms or WINDOWS forms? It would really help us help you if you posted to a more fitting forum other than the top most one.
 
OK, so maybe I'm missing something, but I have a similar issue. I have looked at the link provided, but it is just not clicking in my head. Here's my scenario. I have a video gambling program that opens with form1. In form one the user must choose a face for the deck of cards. I have stored this data in a string which I want to be able to access in form2 (or more) so when the card placeholders are filled, the face chosen on form1 is the one used, not the default (which I have preset)
 
OK, so maybe I'm missing something, but I have a similar issue. I have looked at the link provided, but it is just not clicking in my head. Here's my scenario. I have a video gambling program that opens with form1. In form one the user must choose a face for the deck of cards. I have stored this data in a string which I want to be able to access in form2 (or more) so when the card placeholders are filled, the face chosen on form1 is the one used, not the default (which I have preset)
You are missing something. Everyone is determined to treat forms differently to other objects, but they are NOT different. If create an object from your Form1 and that object needs data, how do you get that data to it? You either pass that data to a method, which may be the constructor, or you assign it to a property. This Form2 is no different. You create the object and then you pass the required data to a method, which may be the constructor, or assign it to a property. Now these methods and properties don't just magically appear. It's up to you to write them. They're just methods and properties declared Public. You may or may not have written properties before but I know you've written methods before.
 
Thanks for the speedy reply. My brain is just not getting it right now. Since this is not currently a NEEDED section of the program, I will set it aside and work on the the other parts for now. I find that if I struggle to long on a particular piece of code, i just get frustrated. Eventually it will come to me.
 
what your saying is that you have a method within form1 that chooses the deck, and you want to pass the selection to form2

the easiest way to do it, is on frm2 call the variable your storing the selection in say strMydeck = frm1.strDeckselect just make sure it's not set as private
 
Back
Top