Visual Basic question

Zap Brannigan

Golden Member
Oct 14, 2004
1,887
0
0
Does anyone here know the ins and outs of the xcalc, I have a program setup and need it to do some simple calculations, two prices and a total cost.

Here's what I have so far,

Public Class MainForm

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
Me.Close()
End Sub

Private Sub xClearButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xClearButton.Click
'clears the contents of the all text boxes and total cost label

Me.xNameTextBox.Text = String.Empty
Me.xNumOfEnvelopesTextBox.Text = String.Empty
Me.xNumOfPagesTextBox.Text = String.Empty
Me.xTotalCostLabel.Text = String.Empty

'set focus to the name text box
Me.xNameTextBox.Focus()

End Sub









Private Sub xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click

End Sub
End Class
 

KLin

Lifer
Feb 29, 2000
30,437
751
126
It's just the name of sub procedure that triggers when you click a button called xCalcButton. It should take values from the textboxes you have setup, do the calculations, then update the totalcostlabel textbox with whatever value it calculated. That's all the help you get from me with your homework. ;)
 

clamum

Lifer
Feb 13, 2003
26,256
406
126
What is "xcalc", a type of program or something?

But if it's just a regular VB program, wouldn't you get the values from the "xNumOfEnvelopesTextBox" and xNumOfPagesTextBox" textboxes, and do an equation like the following and set it equal to the total?: xTotalCostLabel.Text = (numEnvelopes * pricePerEnvelope + numPages * pricePerPage).ToString("C"); ' currency formatted
 

Zap Brannigan

Golden Member
Oct 14, 2004
1,887
0
0
Originally posted by: KLin
It's just the name of sub procedure that triggers when you click a button called xCalcButton. It should take values from the textboxes you have setup, do the calculations, then update the totalcostlabel textbox with whatever value it calculated. That's all the help you get from me with your homework. ;)

Touche! lol

I figured it out on my own, project completed and just remembered to come back here to save some people some time. Thanks for the replies regardless!