473,408 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Change data in th midst of Forms

Hello.
I've got one problem.
I have to forms> Form1 and Form2.
Form1 and form2 are loaded, And I want change some data in Form1 from Form2.
I tryed to write this>>
Dim frm as new form1
frm.textbox1.text="Peter", but this is probably bad, because program show me
error.

How can I do it?
Thanks for answers.
Nov 20 '05 #1
4 977
* "Rado" <r-****@szm.sk> scripsit:
Hello.
I've got one problem.
I have to forms> Form1 and Form2.
Form1 and form2 are loaded, And I want change some data in Form1 from Form2.
I tryed to write this>>
Dim frm as new form1
frm.textbox1.text="Peter", but this is probably bad, because program show me


This will create a new instance of 'Form1' and won't use the original
instance. Instead, you will have to make a reference to the
form's instance available to the other form, for example by passing it
in a parameter of a method or by setting a property.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi Rado,

You did of course understand all Herfried said
However when not, in code it is.

dim frm as new form2
frm.myvalue = "Peter"
frm.show

As public value in beneath the designer generated code in form2
public myvalue as string
And in the loadevent from that form2
me.textbox1.text = myvalue

I hope this helps?

Cor
Nov 20 '05 #3
Hello Herfried K.

Thaks for answer, but I don't exactly understand what you wrote.
Can you write me some example?
Thank you very much for your answer.

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OI**************@tk2msftngp13.phx.gbl...
* "Rado" <r-****@szm.sk> scripsit:
Hello.
I've got one problem.
I have to forms> Form1 and Form2.
Form1 and form2 are loaded, And I want change some data in Form1 from Form2. I tryed to write this>>
Dim frm as new form1
frm.textbox1.text="Peter", but this is probably bad, because program
show me
This will create a new instance of 'Form1' and won't use the original
instance. Instead, you will have to make a reference to the
form's instance available to the other form, for example by passing it
in a parameter of a method or by setting a property.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #4
* "Rado" <r-****@szm.sk> scripsit:
Thaks for answer, but I don't exactly understand what you wrote.
Can you write me some example?
Thank you very much for your answer.


<URL:http://groups.google.de/groups?selm=u5Y8SnOXDHA.1872%40TK2MSFTNGP12.phx.gb l>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
1
by: rcmail14872 | last post by:
I have a standard Access database with standard Forms and it is not split. I am going to run the upsizing wizard to change the data tables to SQL. I also need to split the database and I am going...
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
3
by: Brad Rogers | last post by:
All, Being immersed in vb.net and trying CSharp after almost a year I forgot the differences. I like vb fixing the uppercase/lowercase names and seeming to be more flexible to code entry. ...
6
by: Ben Finney | last post by:
Howdy all, Summary: I'm looking for idioms in unit tests for factoring out repetitive iteration over test data. I explain my current practice, and why it's unsatisfactory. When following...
7
by: Vlad | last post by:
I have a problem of different date formats in an international study, where the data entry module and error checking module are delivered to the data collecting centres. Error checking module...
0
by: zeng.hui.stephen | last post by:
I download the demo http://msdn.microsoft.com/msdnmag/issues/02/10/cuttingedge/. I inherite the demo, and write my code. I want to use Hook to monitor C++ Edit change. I use a C# form...
0
by: morathm | last post by:
I have a windows client database management application written in C# that connects to remote web services to do all the heavy work. The thin-client app uses strong typed datasets, all maintained at...
0
by: Composer | last post by:
More experienced programmers may laugh that I had to struggle with this, but I post it so that others in my position might benefit. My application allows the user to have many forms open. Some...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.