Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 11:27 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ]  Bookmark and Share
Author Message
 Post subject: Help with lblMsg in VB 6
PostPosted: Wed Oct 07, 2009 6:15 pm 
Offline

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
 Profile  
 
 Post subject: Re: Help with lblMsg in VB 6
PostPosted: Fri Oct 09, 2009 1:14 am 
Offline

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
 Profile  
 
 Post subject: Re: Help with lblMsg in VB 6
PostPosted: Fri Oct 09, 2009 6:46 pm 
Offline

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
 Profile  
 
 Post subject: Re: Help with lblMsg in VB 6
PostPosted: Fri Oct 09, 2009 7:38 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review


Webmaster - Excruciating - Johnathan - Kotik - Ash - Tomi - rangana - Phate - dflynn - Medley