Go to Post CD, you are crazy!!! - Tottanka [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 11-03-2004, 14:12
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Exclamation Re: Visual Basic

Quote:
Originally Posted by dddriveman
I am just trying to click on commmand buttons that say Robot COntroller or Battery and they list the price in a picture box. I have all of that done but i cannot get the program to total all of the parts that i have selected becasue my variables will not carry over from the sub command for the command buttons when i press my total button. I am using vb6.0
PICTURE BOX?!?!?!?!? Use a text box, first of all. The Text property is the equivelent of Value.

Are you using Quanity textboxes, too?

say:
  • cbRC_Add as CommandButton
  • cbBat_Add as CommandButton
  • tbRC_Quanity as Textbox
  • lblRC_Total as Label
  • lblRC_Price as Label
  • tbBat_Quanity as Textbox
  • lblBat_Total as Label
  • lblBat_Price as Label
  • tbTotal as Label
These are the controls on your form.

So:
Code:
const RC_Price as currency = 500 'Sub type of variant
const Bat_Price as currency = 100
dim RC_Quanity as long, RC_Total as Currency
dim Bat_Quanity as long, Bat_Total as currency
dim Total as currency

private sub Form_Load ()
 RC_Quanity = 0
 Bat_Quanity = 0
 Update
end sub

Public sub Update()
 RC_Total = RC_Price * RC_Quanity
 Bat_Total = Bat_Price * Bat_Quanity
 Total = RC_Total + Bat_Total

 tbRC_Quanity = RC_Quanity
 tbRC_Total = RC_Total
 lblRC_Price = RC_Price
 tbBat_Quanity = Bat_Quanity
 tbBat_Total = Bat_Total
 lblBat_Price = Bat_Price
 tbTotal = Total
end sub
Be sure to insert Event hadlers for the command buttons and text boxes (Check for correct type).
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help programming in Visual Basic xxlshortys Programming 0 06-04-2003 08:54
Visual Basic 6 Dashboard LBK Rules Programming 1 22-01-2003 13:06
Dashreader.dll: A Visual Basic .NET user control to read the dashboard port Ameya Programming 4 12-01-2003 23:40
Visual Basic - Drag and Drop Gope Programming 11 06-01-2003 09:42
Computer Graphics and Visual Basic Programing Gope General Forum 0 26-10-2002 13:44


All times are GMT -5. The time now is 10:53.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi