|
Your time now: Mon Nov 23, 2009 11:27 am
|
View unanswered posts | View active topics
| Author |
Message |
|
EntangledDesi
|
Post subject: Help with lblMsg in VB 6 Posted: Wed Oct 07, 2009 6:15 pm |
|
Joined: Mon Oct 05, 2009 6:56 pm Posts: 5
|
|
I help with how to get the main form of an application to display a student's name when the main form is first run after they enter their name into a standard dialog box.
|
|
| Top |
|
 |
|
pachecf
|
Post subject: Re: Help with lblMsg in VB 6 Posted: Fri Oct 09, 2009 1:14 am |
|
Joined: Thu Oct 08, 2009 9:18 pm Posts: 6
|
|
On form load event you can add:
lblStudentName.caption = inputbox("Enter your name: " )
As soon as the form loads the student will be prompted to enter his/her name and it will display the input to a label call lblStudentName
|
|
| Top |
|
 |
|
EntangledDesi
|
Post subject: Re: Help with lblMsg in VB 6 Posted: Fri Oct 09, 2009 6:46 pm |
|
Joined: Mon Oct 05, 2009 6:56 pm Posts: 5
|
|
^^I don't need it to create another input box though..I already have a standard dialog box [input box] where they input their name..I need help with how to get the name they put in there when the application runs to display on the main form
|
|
| Top |
|
 |
|
pachecf
|
Post subject: Re: Help with lblMsg in VB 6 Posted: Fri Oct 09, 2009 7:38 pm |
|
Joined: Thu Oct 08, 2009 9:18 pm Posts: 6
|
|
What you probably want to do is to add a public variable. 1. add a module to your project 2. declare a Public variable
Public retStudentName as string 3. Store the value of the student input to that variable and you can use it anywhere in your project.
How to use:
retStudentName = inmputbox(“Student Name”)
Textbox1 = retStudentName Msgbox (retStudentName) lblStudentName.caption = retStudentName
anything = retStudentName
Even form.caption = “Application Name: “ & retStudentName
The best part is that this variable will hold the name of the student and it can be accessed by any form, subroutine, etc. in your project.
Note: I van't used VB6 for a long time. But if it's not Public try Global declaration.
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
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 post attachments in this forum
|
|
|