Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VB6 Question] Getting Form2 to access Form1?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Oblivious
Grandmaster Cheater Supreme
Reputation: 45

Joined: 12 Mar 2008
Posts: 1729

PostPosted: Sun May 11, 2008 11:18 am    Post subject: [VB6 Question] Getting Form2 to access Form1? Reply with quote

How do I do this? It's blowing my mind!
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sun May 11, 2008 11:29 am    Post subject: Reply with quote

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
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Sun May 11, 2008 12:13 pm    Post subject: Reply with quote

Learn the basics of VB6.

Do you mean like:
Code:
form1.command1.caption = "1"
Back to top
View user's profile Send private message
92Garfield
I'm a spammer
Reputation: 57

Joined: 20 Dec 2007
Posts: 5871
Location: Banana Republic Germany

PostPosted: Sun May 11, 2008 12:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
Oblivious
Grandmaster Cheater Supreme
Reputation: 45

Joined: 12 Mar 2008
Posts: 1729

PostPosted: Sun May 11, 2008 12:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Sun May 11, 2008 12:50 pm    Post subject: Reply with quote

dude the syntax is right, are you sure the variable is right?
Back to top
View user's profile Send private message
Oblivious
Grandmaster Cheater Supreme
Reputation: 45

Joined: 12 Mar 2008
Posts: 1729

PostPosted: Sun May 11, 2008 4:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
minium haxor
Advanced Cheater
Reputation: 0

Joined: 03 Dec 2007
Posts: 82
Location: Faroe islands

PostPosted: Sun Jun 01, 2008 4:31 pm    Post subject: Reply with quote

for example if you have a button on form1 that shows form2
Code:
form2.show


if you want to hide form1 while your on form2 then
Code:
form1.hide


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
View user's profile Send private message
Typhoon808
Expert Cheater
Reputation: 0

Joined: 27 Mar 2008
Posts: 175
Location: Wales

PostPosted: Sun Jun 01, 2008 5:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Sun Jun 01, 2008 8:18 pm    Post subject: Reply with quote

You can't use 'Friends' like that in VB6.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sun Jun 01, 2008 8:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
AndrewMan
Grandmaster Cheater Supreme
Reputation: 0

Joined: 01 Aug 2007
Posts: 1257

PostPosted: Sun Jun 01, 2008 9:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
AtheistCrusader
Grandmaster Cheater
Reputation: 6

Joined: 23 Sep 2006
Posts: 681

PostPosted: Mon Jun 02, 2008 12:53 am    Post subject: Reply with quote

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
View user's profile Send private message
minium haxor
Advanced Cheater
Reputation: 0

Joined: 03 Dec 2007
Posts: 82
Location: Faroe islands

PostPosted: Mon Jun 02, 2008 3:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Typhoon808
Expert Cheater
Reputation: 0

Joined: 27 Mar 2008
Posts: 175
Location: Wales

PostPosted: Mon Jun 02, 2008 5:08 am    Post subject: Reply with quote

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. Sad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites