473,326 Members | 2,128 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,326 software developers and data experts.

Linking objects between forms

jed
How can i get access to textbox or an object in another form.I need
to insert a value from a textbox on form1 into a textbox on form2 but
cant get the textbox to appear in intellisense.I am a beginner still
learning C# thanks.

Feb 26 '07 #1
6 1202
On Feb 26, 9:17 am, j...@auto-soft.co.za wrote:
How can i get access to textbox or an object in another form.I need
to insert a value from a textbox on form1 into a textbox on form2 but
cant get the textbox to appear in intellisense.I am a beginner still
learning C# thanks.
you can pass the values in the constructor of form2

Feb 26 '07 #2
jed
Please post example of how to do this thank you


Feb 26 '07 #3
jed
On Feb 26, 1:00 am, "DarkSoul" <dcu...@gmail.comwrote:
On Feb 26, 9:17 am, j...@auto-soft.co.za wrote:
How can i get access to textbox or an object in another form.I need
to insert a value from a textbox on form1 into a textbox on form2 but
cant get the textbox to appear in intellisense.I am a beginner still
learningC# thanks.

you can pass the values in the constructor of form2
Please post example of how to do this. thank you

Feb 26 '07 #4
DarkSoul wrote:
On Feb 26, 9:17 am, j...@auto-soft.co.za wrote:
> How can i get access to textbox or an object in another form.I need
to insert a value from a textbox on form1 into a textbox on form2 but
cant get the textbox to appear in intellisense.I am a beginner still
learning C# thanks.

you can pass the values in the constructor of form2
to add to DarkSoul's reply you need to either pass form1 or the object
you wish to talk to in as a parameter to form2 or populate an existing
value in form2
public class Form1
{
public string objectname = "";

public somemethod()
{
// Create form2 here and pass a reference to Form1 to // the
constructor of form2

Form2 frm = new Form2(this);

// or populate a property of Form2 like this

frm.somepropertyname = this; // you could also populate
this property with whatever object you wish
frm.Show();
}
}

public class Form2
{
public Form thecallingform;

public Form2(Form frm)
{
this.thecallingform = frm;
}

public void anothermethod()
{
this.thecallingform.objectname = "foo";
}
}

hope this helps

Feb 26 '07 #5
jed
Do you have to write all that just to take text from a textbox on
windowsform1 to another textbox on windowsform2.I have a button on
form1 when the user clicks the button i want to transfer the text.
Feb 26 '07 #6
jed
Sorry understand now thanks

Feb 26 '07 #7

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

Similar topics

0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
0
by: Dibyendu Roy | last post by:
Hi All, I build an object called "dblorcle" to connect to oracle database in Sun solaris box. This is built linking with various oracle ".a" (archived, for static linking) files come with standard...
15
by: Rob Ratcliff | last post by:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray X1. It makes heavy use of templates and namespaces. Up until the link step, the C++ source code compiled flawlessly. But, when...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
2
by: sunil | last post by:
Hi, We have lot of c and fortran archive libraries that have complex dependencies. We have different server tasks that use some of these libraries. We have developed a tool inhouse that links...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
3
by: Ken | last post by:
I have a win 2000 database of autographs and scanned photos. They are in the SAME directory. In the table, my "ImagePath" text field shows JUST the image name (i.e. "blank.jpg"). I have an image...
5
by: chrisse_2 | last post by:
Hi, All the records in my database will contain at least one picture. At the moment all the images are part of the database as ole objects although the database is way to big and there is only...
2
by: danthrom | last post by:
Hi all, I am trying to hid a command button which links two forms. The forms are connected by a one-to-many relationship and the second form has details on the first. But if no details are...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.