954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Linking up delphie forms

Please help. I really need to find out how to get a data value from one for onto another form.
For example I put a value in an edit box in Form1 and I want that same value to be in Form2, but if I were to chage the value in Form1 the value in Form2 would also change, without me having to touch it.

If you don't understand what I'm asking plese say. Also I'll be willing to show you my program if you need to further understand what I'm stuck on.

Thank you for reading

bbradley
Newbie Poster
14 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

First of all you need the form names in your uses clauses - if you have the editbox in formOne and want to use the value in formTwo, in formTwo's uses clause, you must have a reference to formOne.

Then to access the value in formTwo, you simply use formOne.editbox.text ...

I hope this makes sense! ;-)

RoryGren
Junior Poster in Training
60 posts since Oct 2007
Reputation Points: 12
Solved Threads: 8
 

It kinda makes sense.

You know you said "...in formTwo's uses clause..." what is a clause?
I'm sorry if that question seems dumb.
Thank you for your help though!

bbradley
Newbie Poster
14 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

I have heard of delphie, but I have never used it. Sorry I cannot help at this time.

Byrdc
Newbie Poster
6 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

It kinda makes sense.

You know you said "...in formTwo's uses clause..." what is a clause? I'm sorry if that question seems dumb. Thank you for your help though!

The uses clause is the bit at the top where it says

"uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;" etc.

zoe256
Newbie Poster
3 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

oh right I see =)

bbradley
Newbie Poster
14 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

hi

1.go to the file tab and click " new form"
2. put a button on the form1
double click the button and go top, on the implementation.
under implementation, put " uses unit2; ( since you have two forms)
then go down under begin and put this code:
button1.enabled:= false;
form2.show;
// then it will take you to form 2

then you put anything to your form1 and put the code i gave you and it will take you to form 2

if it gives error just email me on [email]clive_katly@yahoo.com[/email] ( i am also a newbie in delphi but i get help from my friend's father(programmer). feel free to send me emails

Clive29
Newbie Poster
7 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

IF your are new to Delphi, I strongly recommend you visit http://blogs.codegear.com/nickhodges/index.php?p=26687 for some very good demonstrations on h0ow to work within it.

Good Lcuk.

jsosnowski
Junior Poster in Training
68 posts since Nov 2007
Reputation Points: 11
Solved Threads: 11
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You