great C# Programmers!
please help me, am developing a field farm software, i have 3 forms form1, form2, form3 form1 is just a welcome page then when you proceed to form2, its a data collection, where inputs are collected From textboxes(14 rows and 4 columns) and then multiplied at background and displayed on form3 (on individual labels)
thats the logic but i dont know how to go on with the code, can somebody help me out

Recommended Answers

All 3 Replies

Here is a little C# programmer!
To pass data between forms really isn't that hard.
Example: form3.Label5.Text = form2.TextBox42.Text;

Where you have multiple forms ("views") that need to share data (a "model") you can use Model-View-Controller (MVC) architecture. In simple cases you can ignore the controller and just have a model class or classes that have the data and application logic and view classes that display or input data from/to the model.
Google MVC for more detail, but recognise that most write-ups will cover cases far more complex than yours. One model and three views is all you need. Create the model first, and pass it to form 1. Form 1 can update the model with whatever data it gets. Then pass the same model to form 2, which can query the model for whatever data it needs (etc).

To actually pass the data, using a constructor for form2 that accepts the data and populates the form with it, is probably the simplest way.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.