Flash Games

 FAQ   Search   Members   Groups   Register  User Control Panel      Login 

Your time now:
Mon Nov 23, 2009 9:06 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ]  Bookmark and Share
Author Message
 Post subject: New member has a question
PostPosted: Sat Oct 11, 2008 5:46 pm 
Offline

Joined: Sat Oct 11, 2008 3:41 pm
Posts: 2
Currently, I'm taking my first VB class in college. I'm not looking for homework help, I've already completed the assignment. However I do have a question that hopefully someone can answer.

I had to design and code a simple application where the user would enter a number of pennies say 330 in a text box, click submit, then the results would be displayed in a message box something like this: "330 pennies converts to:" the result would be broken down into the number of dollars, halves, quarters, etc... all the way to pennies.

I created a string message, and built it up over a series of steps to get it the way I wanted, then included it into the MessageBox.Show command to display it. MessageBox.Show(strMessage, "Conversion Results", MessageBoxButtons.OK , MessageBoxIcon.Information)

The program works fine, but my question is this: The message box using 330 pennies would say: "330 pennies converts to:" Is there a code that I can put in the string message that will use whatever numeric value the user places in the textbox? The program was created using VB2005. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2008 6:14 pm 
Offline

Joined: Sun Sep 21, 2008 11:20 am
Posts: 7
What you exactly want to do?

Can you put some more codes?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 11, 2008 8:15 pm 
Offline

Joined: Sat Oct 11, 2008 3:41 pm
Posts: 2
Actually, I figured it out. In the beginning I used TryParse and did this:Int32.TryParse(txtTotalPennies.Text , intTotalPennies)

I had previously declared Dim strmessage As string. After converting my data, all I had to add was strMessage = intTotalPennies.ToString () & "Pennies converts to:"

This allows the initial value entered in the textbox placed in the message box. Thanks for the reply.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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