[RESOLVED] Inputted data into another form
i have to create this hangman type game for college and i'm a bit stuck on get data inputted by the player to be displayed onto another form.
the player will input a clue to help with the guessing of the word (this is entered on one screen)
and it needs to be displayed on another form, but i don't know how to do this could anyone help please.
cheers James
Re: Inputted data into another form
Welcome to VBForums, James :wave:
You can simply put a Label (name it for example "lblInput") on the second Form and display the input data like this:
Code:
secondFormName.lblInput.Caption = yourInputHere
Re: Inputted data into another form
how would that work getting the data from a different form.
i have a text box on one form where the player can input the clue, and it needs to be displayed on the game play form.
sorry i only started using VB today lol and it all has to handed in tommorow
1 Attachment(s)
Re: Inputted data into another form
Check this sample. Hope you understand it :)
Re: Inputted data into another form
yeah that makes sense to me
i attached the file with what i have up to now
Re: Inputted data into another form
Btw... you don't need to use the "Load" expression everytime you're refering to some Form. Every call to some Forms method, function or property envokes the Form automatically so it's already loaded.
Nice work for one day, though ;)
Re: Inputted data into another form
cheers
i know i understood the sample you showed me which is probably the first thing i have understood all day but i'm still having a few problems in loading the clue up :(
Re: Inputted data into another form
If your "How to play" Form was finished i could help you with that... :bigyello:
How do you want to use the "clue" and why does the word only have 6 letters?
Re: Inputted data into another form
the game is only suppose to have 6-letters according to our tutor, don;t ask me why.
the clue is supposed to be a hint to help guess the word which will be entered of the "frmWordClue"
then when you click on the "click to play" button it is supposed to be displayed in the label which is under the title at the top of the page
out of all the pages the "how to play" form is the easiest but want to get the rest done first lol
when i've done the clue part i have to start on the drag and drop side of the game :S
Re: Inputted data into another form
Well... i/we 'll be glad to help you with some specific problem/s if you'll encounter some in the near future :) Good luck!
If you concider this thread to be resolved then please pull-down the 'Thread Tools' menu and 'Mark Thread Resolved' so people will know you got your answer :wave:
Re: Inputted data into another form
cheers for the help,
but i think i may be doing something wrong as its not working :sick:
Re: Inputted data into another form
Quote:
Originally Posted by DeadDude
cheers for the help,
but i think i may be doing something wrong as its not working :sick:
What exactly is that?
Re: Inputted data into another form
i used the example to help me with the displaying of the clue on the game screen form but for some reason it won't display
Re: Inputted data into another form
Add the bold line:
Code:
Private Sub cmdClickToPlay_Click()
Load frmGameScreen
frmGameScreen.lblInput.Caption = EnterClue1.Text
frmGameScreen.Show
Unload Me
End Sub
Also, learn how to use Option Explicit in each of your modules (see my example). To use it in your every module by default, go to menu Tools>>Options>>Editor>>... and tick Require Variable Declaration.
Re: Inputted data into another form
cheers that worked fine fanx :)
fanx for the help dude :wave:
Re: [RESOLVED] Inputted data into another form