|
-
Nov 20th, 2009, 08:46 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Carrying Information Over From Form To Form
I do have a question to ask regarding the carry-over of information from one form to the next.
If I were to use two forms, say Form1 and Form2, and Form1 originally displays default information in a Label box (as "0"), and then just before Form1 turns to Form2, the Label box turns from "0" to "1", and the "1" should be carried over to the next form. What would I have to do in order to have such successful carry-over?
BTW, this carry-over relates to a scoring system for the Card Sharks game I am currently developing.
-
Nov 20th, 2009, 08:50 AM
#2
Re: Carrying Information Over From Form To Form
If you want to set the value of a control on another form, use the name of the form as well as the control, eg:
Code:
Form2.lblScore.Caption = lblScore.Caption
-
Nov 20th, 2009, 12:33 PM
#3
Thread Starter
Fanatic Member
Re: [RESOLVED] Carrying Information Over From Form To Form
Thanks! It works perfectly!
-
Feb 6th, 2010, 05:13 PM
#4
Thread Starter
Fanatic Member
Re: [RESOLVED] Carrying Information Over From Form To Form
Got one problem as I attempted this carryover of label information from Round1k to Round2j:
Code:
Private Sub NextForm()
Round2j.Show
Round1k.Hide
Round2j.RWin.Caption = RWin.Caption
Round2j.BWin.Caption = BWin.Caption
Round2j.CurQues.Caption = CurQues.Caption
For i = 0 To 1
Round2j.lblRName(i).Caption = lblRName(i).Caption
Round2j.lblBName(i).Caption = lblBName(i).Caption
Round2j.lblRNameBar.Caption = lblRNameBar.Caption
Round2j.lblBNameBar.Caption = lblBNameBar.Caption
Round2j.RScore(i).Caption = RScore(i).Caption
Round2j.BScore(i).Caption = BScore(i).Caption
Next
End Sub
The information in those captions will not carry over for some strange reason. What would I have to do to allow for a smooth carryover?
-
Feb 6th, 2010, 05:19 PM
#5
Thread Starter
Fanatic Member
Re: [RESOLVED] Carrying Information Over From Form To Form
^ Never mind, I figured out the problem myself.
-
Feb 6th, 2010, 05:46 PM
#6
Re: [RESOLVED] Carrying Information Over From Form To Form
Jon as I've mentioned before, you really shouldn't use labels to carry program information. The way to carry such program information is to create a Public variable in your GameEssentials6 code module and use that instead. There are no advantages to using labels.
-
Feb 9th, 2010, 06:10 AM
#7
Thread Starter
Fanatic Member
Re: [RESOLVED] Carrying Information Over From Form To Form
No problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|