| View previous topic :: View next topic |
| Author |
Message |
Oblivious Grandmaster Cheater Supreme
Reputation: 45
Joined: 12 Mar 2008 Posts: 1729
|
Posted: Sun May 11, 2008 11:18 am Post subject: [VB6 Question] Getting Form2 to access Form1? |
|
|
| How do I do this? It's blowing my mind! |
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun May 11, 2008 11:29 am Post subject: |
|
|
what do you mean by accessing form1 can you be more specific?
or you mean by access to get focus on form1 when form2 is still open? _________________
Stylo |
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sun May 11, 2008 12:13 pm Post subject: |
|
|
Learn the basics of VB6.
Do you mean like: | Code: | | form1.command1.caption = "1" |
|
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Sun May 11, 2008 12:26 pm Post subject: |
|
|
| masterkert3 wrote: | Learn the basics of VB6.
Do you mean like: | Code: | | form1.command1.caption = "1" |
|
arf
how should he learn if everybody just tells him so
but you are right
in general its
(form name).(object).properity = .... _________________
|
|
| Back to top |
|
 |
Oblivious Grandmaster Cheater Supreme
Reputation: 45
Joined: 12 Mar 2008 Posts: 1729
|
Posted: Sun May 11, 2008 12:47 pm Post subject: |
|
|
| 1qaz wrote: | what do you mean by accessing form1 can you be more specific?
or you mean by access to get focus on form1 when form2 is still open? |
Ok, you press a money button, form 2 pops up, (Form2.Show)
There's a text box and it supposed to change _root.money or w/e to the value...but it won't work!
Here's code:
| Code: | | Call Form1.ShockwaveFlash1.SetVariable("_root.money", Form2.Text1.Text) |
|
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sun May 11, 2008 12:50 pm Post subject: |
|
|
| dude the syntax is right, are you sure the variable is right? |
|
| Back to top |
|
 |
Oblivious Grandmaster Cheater Supreme
Reputation: 45
Joined: 12 Mar 2008 Posts: 1729
|
Posted: Sun May 11, 2008 4:23 pm Post subject: |
|
|
| masterkert3 wrote: | | dude the syntax is right, are you sure the variable is right? |
I know the var is right, I'll try again. |
|
| Back to top |
|
 |
minium haxor Advanced Cheater
Reputation: 0
Joined: 03 Dec 2007 Posts: 82 Location: Faroe islands
|
Posted: Sun Jun 01, 2008 4:31 pm Post subject: |
|
|
for example if you have a button on form1 that shows form2
if you want to hide form1 while your on form2 then
if you want for example a button on form1 to add something to text1 on form2 then
| Code: | | form2.text1.text = hello | fx
hope it helped _________________
|
|
| Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Sun Jun 01, 2008 5:39 pm Post subject: |
|
|
You could create a module with global variables.
Then declare the form2 textbox with a global variable.
| Code: | | Friend frm2TextBox As Form2.TextBox1.Text |
Then just use: Call Form1.ShockwaveFlash1.SetVariable("_root.money", frm2TextBox) |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Sun Jun 01, 2008 8:18 pm Post subject: |
|
|
You can't use 'Friends' like that in VB6. _________________
- Retired. |
|
| Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Sun Jun 01, 2008 8:55 pm Post subject: |
|
|
unfortunately VB6 can only do
function frm2TextBox() as string
frm2TextBox = Form2.TextBox1.Text
end function
and then your
Call Form1.ShockwaveFlash1.SetVariable("_root.money", frm2TextBox) _________________
Get kidnapped often. |
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Sun Jun 01, 2008 9:40 pm Post subject: |
|
|
| clickflick22 wrote: | | 1qaz wrote: | what do you mean by accessing form1 can you be more specific?
or you mean by access to get focus on form1 when form2 is still open? |
Ok, you press a money button, form 2 pops up, (Form2.Show)
There's a text box and it supposed to change _root.money or w/e to the value...but it won't work!
Here's code:
| Code: | | Call Form1.ShockwaveFlash1.SetVariable("_root.money", Form2.Text1.Text) |
|
Change Text1 to TextBox1 _________________
|
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Mon Jun 02, 2008 12:53 am Post subject: |
|
|
| AndrewMan wrote: | | clickflick22 wrote: | | 1qaz wrote: | what do you mean by accessing form1 can you be more specific?
or you mean by access to get focus on form1 when form2 is still open? |
Ok, you press a money button, form 2 pops up, (Form2.Show)
There's a text box and it supposed to change _root.money or w/e to the value...but it won't work!
Here's code:
| Code: | | Call Form1.ShockwaveFlash1.SetVariable("_root.money", Form2.Text1.Text) |
|
Change Text1 to TextBox1 |
You know by default Text1.text is right. (VB6 doesn't put TextBox1 as name.) |
|
| Back to top |
|
 |
minium haxor Advanced Cheater
Reputation: 0
Joined: 03 Dec 2007 Posts: 82 Location: Faroe islands
|
Posted: Mon Jun 02, 2008 3:13 am Post subject: |
|
|
| masterkert3 wrote: | | AndrewMan wrote: | | clickflick22 wrote: | | 1qaz wrote: | what do you mean by accessing form1 can you be more specific?
or you mean by access to get focus on form1 when form2 is still open? |
Ok, you press a money button, form 2 pops up, (Form2.Show)
There's a text box and it supposed to change _root.money or w/e to the value...but it won't work!
Here's code:
| Code: | | Call Form1.ShockwaveFlash1.SetVariable("_root.money", Form2.Text1.Text) |
|
Change Text1 to TextBox1 |
You know by default Text1.text is right. (VB6 doesn't put TextBox1 as name.) |
yes it does actually if you go to components then choose microsoft forms 2.0 library then choose that text its called textbox1 as standard _________________
|
|
| Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Mon Jun 02, 2008 5:08 am Post subject: |
|
|
| Wiccaan wrote: | | You can't use 'Friends' like that in VB6. |
Oh, sorry Wiccaan. I started out in VB.NET, tried using VB6, but I didn't like it at all.  |
|
| Back to top |
|
 |
|