|
-
Aug 3rd, 2004, 07:12 PM
#1
Thread Starter
New Member
Creating a popup window for results
Hi all! As you may or may not know, I am returning to the VB world after being away from VB for about 4 years or so. I could really use some help with my coding, so please bear with me. I may ask some simple questions from time to time. I just hope that you all have some patience when it comes to my lack of knowledge.
I'm working on this program for my job. It will ultimately calculate ideal yield per sheet of material. I am first attempting to code the math portion of the program & have already ran into problems. Could someone please tell me how to create a popup window that would show the results of my math? I have several text boxes where users will enter integers and users will click on the "Calculate" button to perform the math. For now, I just want to verify my math via a popup window, but do not know how to create one. If someone could please help me out with this, I would really appreciate it. Thanks in advance!
-
Aug 4th, 2004, 01:30 PM
#2
Better off putting this is the VB5/6 forum.
What kind of popup,
Messagebox
form
msn messenger type popup etc?
-
Aug 4th, 2004, 06:31 PM
#3
Thread Starter
New Member
Oh sorry. Hopefully the admin will move this thread.
Anyways, I'm looking to multiply the values of 2 text boxes and have the result show in a message box. I have the syntax down for showing a message box, but do not know how to show the results of the multiplication operation. Can you help? Thanks!
-
Aug 5th, 2004, 10:25 AM
#4
Member
MsgBox CStr(ValueA * ValueB), vbOkOnly, "Calc Result"
-
Aug 5th, 2004, 09:40 PM
#5
Thread Starter
New Member
Thanks, I got the coding down for this section for the most part. Now what I'm trying to do is to multiply 2 values together & then add a value to that result. Here's the code I have which doesn't work...
Dim Multiply As Integer
Dim Result As Integer
Multiply = Val(pieceheight.Text) * Val(piecewidth.Text) + Val(kerf.Text)
Result = MsgBox(Val(Multiply), vbOKOnly + vbInformation, "Total Square Inches")
When I run the program the values of the "pieceheight" & "piecewidth" get multiplied together, but the addition of the "kerf" value does not get added to the result. If I change the + sign to a * sign, it works fine. Anyone have any suggestions as to fix this? Thanks!
-
Aug 19th, 2004, 02:11 PM
#6
Try declaring the multiply variable as a long.
-
Aug 19th, 2004, 02:17 PM
#7
Thread Starter
New Member
Yeah, I recently realized that the variable declaration was an integer instead of a float (long). I realized this one night right before I fell asleep in bed. It's weird where & when you think of the answers to problems, huh?
Next step in the program is to complete the math in the program, then onto the graphical section of the program (gonna be real tough I think!)
Thanks for your help so far!
-
Aug 20th, 2004, 08:28 AM
#8
don't worry.
Don't worry everyone's here to help.
Cheers,
Abhijit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|