Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » Absolutely New to VB.Net and Need a Little Help


Absolutely New to VB.Net and Need a Little Help

Reply
  #1 (permalink)  
Old 07-23-05, 02:23 PM
nothingofvalue nothingofvalue is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Absolutely New to VB.Net and Need a Little Help

Hey all,

I have just recently (couple of days) begun to learn VB.Net. I do not have any other programming experience other than some novice php coding, however, I have been "studying" through books and the internet. I am making pretty good progress with my understanding considering the time frame, but I think I am just totally missing something as it seems I keep running into the same problems over and over and I believe I am simply making a simple mistake but I cannot figure it out.

Basically I am trying to make a calculator that will calculate Ebay fees. I am getting lots of bugs that I am doing a fair job of working out, but I think I am very confused with why/when/how to convert variables as that seems to be my most encountered problem.

For instance, I want to read the value from a textbox, evaluate the value and then perform a simple mathematical computation based upon the evaluation, then print the computation in a label field. Here is the code I have tried (don't laugh too hard):

Private Sub EbayFees()

If Val(TextBox2.Text <= 25) Then
Label4.Text = Val(TextBox2.Text * 0.0525)
End If
End Sub

Obviously there would be more similar evaluations to follow if I can ever get the first one to work. When I try this, I get the following error:

An unhandled exception of type 'System.NullReferenceException' occurred in microsoft.visualbasic.dll

Additional information: Object reference not set to an instance of an object.

I know that this is probably very simple, however, it's not simple for me. If someone can point out what I am doing wrong I would appreciate it. Like I said, I think (actually I know) that I am not grasping the whole variable thing entirely.

Thanks in advance
__________________
http://www.nothingofvalue.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-23-05, 03:04 PM
elnerdo elnerdo is offline
Newbie Coder
 
Join Date: Feb 2005
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Code with option strict on from the start. It will point out these small errors as you get them rather than letting them build into a larger error. On that note.

Your if-statement should be changed to this:

Code:
Private Sub EbayFees()

dim Text2Value as integer = double.parse(textbox2.text)

If text2value <= 25 Then
Label4.Text = convert.tostring(text2value * 0.0525)
End If
End Sub
The val function doesn't seem good. It looks like a legacy things. To convert to an integer from a string you can use Integer.parse (or double.parse for decimals). And to do any other type of conversion at all you use convert.to***** (When you type convert. vb.net will pop up a huge list). Also, you're probably not here yet, but for reusability of your code, you should try using functions instead:

Code:
private function EbayFees(byval Value as double) as double
 
If value <=25 then
return(value * 0.0525)
else
return value 'I guess that's how they work.. <shrug>
end if
 
end function
That function could be used like so:

Code:
Private sub BtnCompute_Click(byval sender as object, byval e as system.buttoneventargs) handles btncompute.click 'That's not really how it the button click sub looks, but it's close.  

Label4.text = Convert.tostring(EbayFees(double.parse(textbox1.text)))

end sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-23-05, 03:56 PM
nothingofvalue nothingofvalue is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Alrighty then........

I "THINK" that I made the change you reccommended, however, it no worky. Now I do not get the error, however, one of the few things that did work correctly, the computation of the listing fee, now does not function correctly?

Here is all of the code, thought not finished, and obviously not correct:

Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents Panel2 As System.Windows.Forms.Panel
Friend WithEvents Panel3 As System.Windows.Forms.Panel
Friend WithEvents Label15 As System.Windows.Forms.Label
Friend WithEvents Label16 As System.Windows.Forms.Label
Friend WithEvents Label18 As System.Windows.Forms.Label
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents ComboBox2 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox3 As System.Windows.Forms.ComboBox
Friend WithEvents ComboBox4 As System.Windows.Forms.ComboBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents Label11 As System.Windows.Forms.Label
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.LinkLabel1 = New System.Windows.Forms.LinkLabel()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.Label15 = New System.Windows.Forms.Label()
Me.Label16 = New System.Windows.Forms.Label()
Me.Label18 = New System.Windows.Forms.Label()
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.ComboBox2 = New System.Windows.Forms.ComboBox()
Me.ComboBox3 = New System.Windows.Forms.ComboBox()
Me.ComboBox4 = New System.Windows.Forms.ComboBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.Button1 = New System.Windows.Forms.Button()
Me.Label2 = New System.Windows.Forms.Label()
Me.TextBox3 = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.Label9 = New System.Windows.Forms.Label()
Me.Label10 = New System.Windows.Forms.Label()
Me.Label11 = New System.Windows.Forms.Label()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'LinkLabel1
'
Me.LinkLabel1.BackColor = System.Drawing.Color.Black
Me.LinkLabel1.Font = New System.Drawing.Font("Courier New", 10.2!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LinkLabel1.Location = New System.Drawing.Point(8, 328)
Me.LinkLabel1.Name = "LinkLabel1"
Me.LinkLabel1.Size = New System.Drawing.Size(904, 32)
Me.LinkLabel1.TabIndex = 0
Me.LinkLabel1.TabStop = True
Me.LinkLabel1.Tag = "http://www.nothingofvalue.com"
Me.LinkLabel1.Text = "www.NothingofValue.com"
Me.LinkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.Black
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(912, 16)
Me.Panel1.TabIndex = 1
'
'Panel2
'
Me.Panel2.BackColor = System.Drawing.Color.Black
Me.Panel2.Location = New System.Drawing.Point(0, 16)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(16, 720)
Me.Panel2.TabIndex = 2
'
'Panel3
'
Me.Panel3.BackColor = System.Drawing.Color.Black
Me.Panel3.Location = New System.Drawing.Point(912, 0)
Me.Panel3.Name = "Panel3"
Me.Panel3.Size = New System.Drawing.Size(16, 720)
Me.Panel3.TabIndex = 3
'
'Label15
'
Me.Label15.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Label15.Font = New System.Drawing.Font("Arial", 13.8!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label15.Location = New System.Drawing.Point(16, 16)
Me.Label15.Name = "Label15"
Me.Label15.Size = New System.Drawing.Size(896, 32)
Me.Label15.TabIndex = 32
Me.Label15.Text = "Your Listing Information"
Me.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label16
'
Me.Label16.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label16.Location = New System.Drawing.Point(24, 56)
Me.Label16.Name = "Label16"
Me.Label16.Size = New System.Drawing.Size(160, 24)
Me.Label16.TabIndex = 33
Me.Label16.Text = "Listing Price"
Me.Label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label18
'
Me.Label18.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label18.Location = New System.Drawing.Point(24, 88)
Me.Label18.Name = "Label18"
Me.Label18.Size = New System.Drawing.Size(160, 32)
Me.Label18.TabIndex = 35
Me.Label18.Text = "Add-on Fees"
Me.Label18.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ComboBox1
'
Me.ComboBox1.Location = New System.Drawing.Point(200, 88)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(155, 24)
Me.ComboBox1.TabIndex = 36
Me.ComboBox1.Text = "Select"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(200, 56)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 37
Me.TextBox1.Text = ""
'
'ComboBox2
'
Me.ComboBox2.Location = New System.Drawing.Point(384, 88)
Me.ComboBox2.Name = "ComboBox2"
Me.ComboBox2.Size = New System.Drawing.Size(155, 24)
Me.ComboBox2.TabIndex = 38
Me.ComboBox2.Text = "Select"
'
'ComboBox3
'
Me.ComboBox3.Location = New System.Drawing.Point(568, 88)
Me.ComboBox3.Name = "ComboBox3"
Me.ComboBox3.Size = New System.Drawing.Size(155, 24)
Me.ComboBox3.TabIndex = 39
Me.ComboBox3.Text = "Select"
'
'ComboBox4
'
Me.ComboBox4.Location = New System.Drawing.Point(744, 88)
Me.ComboBox4.Name = "ComboBox4"
Me.ComboBox4.Size = New System.Drawing.Size(155, 24)
Me.ComboBox4.TabIndex = 40
Me.ComboBox4.Text = "Select"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Arial", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(336, 56)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(120, 24)
Me.Label1.TabIndex = 41
Me.Label1.Text = "Selling Price"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(472, 56)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.TabIndex = 42
Me.TextBox2.Text = ""
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(296, 208)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(112, 24)
Me.Button1.TabIndex = 43
Me.Button1.Text = "Calculate"
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(24, 128)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(160, 32)
Me.Label2.TabIndex = 44
Me.Label2.Text = "Shipping Charged"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'TextBox3
'
Me.TextBox3.Location = New System.Drawing.Point(200, 128)
Me.TextBox3.Name = "TextBox3"
Me.TextBox3.TabIndex = 45
Me.TextBox3.Text = ""
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(736, 160)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(160, 24)
Me.Label3.TabIndex = 46
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(736, 200)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(160, 24)
Me.Label4.TabIndex = 47
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(736, 248)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(160, 24)
Me.Label5.TabIndex = 48
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label6
'
Me.Label6.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.Location = New System.Drawing.Point(552, 160)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(160, 24)
Me.Label6.TabIndex = 49
Me.Label6.Text = "Ebay Listing Fee"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(552, 200)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(160, 24)
Me.Label7.TabIndex = 50
Me.Label7.Text = "Ebay Final Value Fee"
Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.Location = New System.Drawing.Point(552, 248)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(160, 24)
Me.Label8.TabIndex = 51
Me.Label8.Text = "PayPal Fees"
Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label9
'
Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label9.Location = New System.Drawing.Point(552, 288)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(160, 24)
Me.Label9.TabIndex = 52
Me.Label9.Text = "Total Fees"
Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label10
'
Me.Label10.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.2!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label10.Location = New System.Drawing.Point(736, 288)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(160, 24)
Me.Label10.TabIndex = 53
Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Label11
'
Me.Label11.Location = New System.Drawing.Point(168, 288)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(336, 24)
Me.Label11.TabIndex = 54
Me.Label11.Text = "Simply enter your data and press ""Calculate"""
Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(32, 288)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 55
Me.Button2.Text = "Exit"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(320, 256)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 56
Me.Button3.Text = "Reset"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 15)
Me.ClientSize = New System.Drawing.Size(928, 360)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button3, Me.Button2, Me.Label11, Me.Label10, Me.Label9, Me.Label8, Me.Label7, Me.Label6, Me.Label5, Me.Label4, Me.Label3, Me.TextBox3, Me.Label2, Me.Button1, Me.TextBox2, Me.Label1, Me.ComboBox4, Me.ComboBox3, Me.ComboBox2, Me.TextBox1, Me.ComboBox1, Me.Label18, Me.Label16, Me.Label15, Me.Panel3, Me.Panel2, Me.Panel1, Me.LinkLabel1})
Me.MaximumSize = New System.Drawing.Size(936, 400)
Me.MinimumSize = New System.Drawing.Size(936, 400)
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n
Me.Text = "Ebay and Paypal Fee Calculator"
Me.ResumeLayout(False)

End Sub

#End Region
'declare variables
Dim a As String = 0.25 'Listing fee under .99
Dim b As String = 0.35 'Listning fee under 9.99
Dim c As String = 0.6 'Listing fee under 49.99
Dim d As String = 2.4 'Listing fee under 199.99
Dim f As String = 3.6 'Listing fee under 499.99
Dim g As String = 4.8 'Listing fee over 499.99



Private Sub EbayFees()

'Compute the initial ebay listing fee
If Val(TextBox1.Text) <= 0.99 Then
TextBox1.Text = a
ElseIf Val(TextBox1.Text) > 0.99 And Val(TextBox1.Text) <= 9.99 Then
TextBox1.Text = b
ElseIf Val(TextBox1.Text) > 9.99 And Val(TextBox1.Text) <= 49.99 Then
TextBox1.Text = c
ElseIf Val(TextBox1.Text) > 49.99 And Val(TextBox1.Text) <= 199.99 Then
TextBox1.Text = d
ElseIf Val(TextBox1.Text) > 199.99 And Val(TextBox1.Text) <= 499.99 Then
TextBox1.Text = f
ElseIf Val(TextBox1.Text) > 499.99 Then
TextBox1.Text = g
End If

'End ebay initial listing fee calculation

'compute final value fee
Dim Text2Value As Integer = Double.Parse(TextBox2.Text)
If Text2Value <= 25 Then
Label4.Text = Convert.ToString(Text2Value * 0.0525)
ElseIf Text2Value > 25 And Text2Value <= 1000 Then
Label4.Text = Convert.ToString((Text2Value - 25) * 0.0275 + 1.31)
ElseIf Text2Value > 1000 Then
Label4.Text = Convert.ToString((Text2Value - 1000) * 0.015 + 28.12)
End If

End Sub
Private Sub Options()
'compute the value of each option selection combo1

If (ComboBox1.Text = "Select") Then
ComboBox1.Text = 0
ElseIf ComboBox1.Text = ("Gallery Picture") Then
ComboBox1.Text = 0.35
ElseIf ComboBox1.Text = ("Listing Designer") Then
ComboBox1.Text = 0.1
ElseIf ComboBox1.Text = ("Item Subtitle") Then
ComboBox1.Text = 0.5
ElseIf ComboBox1.Text = ("Bold") Then
ComboBox1.Text = 1
ElseIf ComboBox1.Text = ("10 Day Auction") Then
ComboBox1.Text = 0.4
ElseIf ComboBox1.Text = ("Gift Service") Then
ComboBox1.Text = 0.25
ElseIf ComboBox1.Text = ("Border") Then
ComboBox1.Text = 3
ElseIf ComboBox1.Text = ("Highlight") Then
ComboBox1.Text = 5
ElseIf ComboBox1.Text = ("Featured Plus") Then
ComboBox1.Text = 19.95
ElseIf ComboBox1.Text = ("Gallery Featured") Then
ComboBox1.Text = 19.95
ElseIf ComboBox1.Text = ("Home Page Featured") Then
ComboBox1.Text = 39.95
ElseIf ComboBox1.Text = ("Scheduled Listing") Then
ComboBox1.Text = 0.1
End If
'compute the value of each selection combo2
If (ComboBox2.Text = "Select") Then
ComboBox2.Text = 0
ElseIf ComboBox2.Text = ("Gallery Picture") Then
ComboBox2.Text = 0.35
ElseIf ComboBox2.Text = ("Listing Designer") Then
ComboBox2.Text = 0.1
ElseIf ComboBox2.Text = ("Item Subtitle") Then
ComboBox2.Text = 0.5
ElseIf ComboBox2.Text = ("Bold") Then
ComboBox2.Text = 1
ElseIf ComboBox2.Text = ("10 Day Auction") Then
ComboBox2.Text = 0.4
ElseIf ComboBox2.Text = ("Gift Service") Then
ComboBox2.Text = 0.25
ElseIf ComboBox2.Text = ("Border") Then
ComboBox2.Text = 3
ElseIf ComboBox2.Text = ("Highlight") Then
ComboBox2.Text = 5
ElseIf ComboBox2.Text = ("Featured Plus") Then
ComboBox2.Text = 19.95
ElseIf ComboBox2.Text = ("Gallery Featured") Then
ComboBox2.Text = 19.95
ElseIf ComboBox2.Text = ("Home Page Featured") Then
ComboBox2.Text = 39.95
ElseIf ComboBox2.Text = ("Scheduled Listing") Then
ComboBox2.Text = 0.1

End If

'compute the value of each selection combo3
If (ComboBox3.Text = "Select") Then
ComboBox3.Text = 0
ElseIf ComboBox3.Text = ("Gallery Picture") Then
ComboBox3.Text = 0.35
ElseIf ComboBox3.Text = ("Listing Designer") Then
ComboBox3.Text = 0.1
ElseIf ComboBox3.Text = ("Item Subtitle") Then
ComboBox3.Text = 0.5
ElseIf ComboBox3.Text = ("Bold") Then
ComboBox3.Text = 1
ElseIf ComboBox3.Text = ("10 Day Auction") Then
ComboBox3.Text = 0.4
ElseIf ComboBox3.Text = ("Gift Service") Then
ComboBox3.Text = 0.25
ElseIf ComboBox3.Text = ("Border") Then
ComboBox3.Text = 3
ElseIf ComboBox3.Text = ("Highlight") Then
ComboBox3.Text = 5
ElseIf ComboBox3.Text = ("Featured Plus") Then
ComboBox3.Text = 19.95
ElseIf ComboBox3.Text = ("Gallery Featured") Then
ComboBox3.Text = 19.95
ElseIf ComboBox3.Text = ("Home Page Featured") Then
ComboBox3.Text = 39.95
ElseIf ComboBox3.Text = ("Scheduled Listing") Then
ComboBox3.Text = 0.1

End If

'compute the value of each selection combo4
If (ComboBox4.Text = "Select") Then
ComboBox4.Text = 0
ElseIf ComboBox4.Text = ("Gallery Picture") Then
ComboBox4.Text = 0.35
ElseIf ComboBox4.Text = ("Listing Designer") Then
ComboBox4.Text = 0.1
ElseIf ComboBox4.Text = ("Item Subtitle") Then
ComboBox4.Text = 0.5
ElseIf ComboBox4.Text = ("Bold") Then
ComboBox4.Text = 1
ElseIf ComboBox4.Text = ("10 Day Auction") Then
ComboBox4.Text = 0.4
ElseIf ComboBox4.Text = ("Gift Service") Then
ComboBox4.Text = 0.25
ElseIf ComboBox4.Text = ("Border") Then
ComboBox4.Text = 3
ElseIf ComboBox4.Text = ("Highlight") Then
ComboBox4.Text = 5
ElseIf ComboBox4.Text = ("Featured Plus") Then
ComboBox4.Text = 19.95
ElseIf ComboBox4.Text = ("Gallery Featured") Then
ComboBox4.Text = 19.95
ElseIf ComboBox4.Text = ("Home Page Featured") Then
ComboBox4.Text = 39.95
ElseIf ComboBox4.Text = ("Scheduled Listing") Then
ComboBox4.Text = 0.1

End If







End Sub










Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

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

Label3.Text = "$0.00"
Label4.Text = "$0.00"
Label5.Text = "$0.00"
Label10.Text = "$0.00"



'items for combo box 1
ComboBox1.Items.Add("Select")
ComboBox1.Items.Add("Gallery Picture")
ComboBox1.Items.Add("Listing Designer")
ComboBox1.Items.Add("Item Subtitle")
ComboBox1.Items.Add("Bold")
ComboBox1.Items.Add("10 Day Auction")
ComboBox1.Items.Add("Gift Service")
ComboBox1.Items.Add("Border")
ComboBox1.Items.Add("Highlight")
ComboBox1.Items.Add("Featured Plus")
ComboBox1.Items.Add("Gallery Featured")
ComboBox1.Items.Add("Home Page Featured")
ComboBox1.Items.Add("Scheduled Listing")
ComboBox1.SelectedIndex = 0

'items for combo box 2
ComboBox2.Items.Add("Select")
ComboBox2.Items.Add("Gallery Picture")
ComboBox2.Items.Add("Listing Designer")
ComboBox2.Items.Add("Item Subtitle")
ComboBox2.Items.Add("Bold")
ComboBox2.Items.Add("10 Day Auction")
ComboBox2.Items.Add("Gift Service")
ComboBox2.Items.Add("Border")
ComboBox2.Items.Add("Highlight")
ComboBox2.Items.Add("Featured Plus")
ComboBox2.Items.Add("Gallery Featured")
ComboBox2.Items.Add("Home Page Featured")
ComboBox2.Items.Add("Scheduled Listing")
ComboBox2.SelectedIndex = 0

'items for combo box 3
ComboBox3.Items.Add("Select")
ComboBox3.Items.Add("Gallery Picture")
ComboBox3.Items.Add("Listing Designer")
ComboBox3.Items.Add("Item Subtitle")
ComboBox3.Items.Add("Bold")
ComboBox3.Items.Add("10 Day Auction")
ComboBox3.Items.Add("Gift Service")
ComboBox3.Items.Add("Border")
ComboBox3.Items.Add("Highlight")
ComboBox3.Items.Add("Featured Plus")
ComboBox3.Items.Add("Gallery Featured")
ComboBox3.Items.Add("Home Page Featured")
ComboBox3.Items.Add("Scheduled Listing")
ComboBox3.SelectedIndex = 0

'items for combo box 4
ComboBox4.Items.Add("Select")
ComboBox4.Items.Add("Gallery Picture")
ComboBox4.Items.Add("Listing Designer")
ComboBox4.Items.Add("Item Subtitle")
ComboBox4.Items.Add("Bold")
ComboBox4.Items.Add("10 Day Auction")
ComboBox4.Items.Add("Gift Service")
ComboBox4.Items.Add("Border")
ComboBox4.Items.Add("Highlight")
ComboBox4.Items.Add("Featured Plus")
ComboBox4.Items.Add("Gallery Featured")
ComboBox4.Items.Add("Home Page Featured")
ComboBox4.Items.Add("Scheduled Listing")
ComboBox4.SelectedIndex = 0



End Sub


Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged


End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'send error message if no value is entered for the list price
If (TextBox1.Text = "") Then
MsgBox("You Have Not Entered A List Price", MsgBoxStyle.OKOnly, "Oops!")
End If
'send error message if no value is entered for the sales price
If TextBox2.Text = "" Then
MsgBox("You Must Enter A Sales Price", MsgBoxStyle.OKOnly, "Oops!")
End If
If IsNumeric(TextBox1.Text) = True And IsNumeric(TextBox2.Text) = True Then
Options()
Else : Reset()

End If

'print ebay listing fee
Label3.Text = "$" & Val(TextBox1.Text) + Val(ComboBox1.Text) + Val(ComboBox2.Text) _
+ Val(ComboBox3.Text) + Val(ComboBox4.Text)



End Sub

Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs ) Handles LinkLabel1.LinkClicked
System.Diagnostics.Process.Start(LinkLabel1.Tag)
End Sub

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged


End Sub

Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged


End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub

Private Sub Label3_Display(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.VisibleChanged

End Sub

Private Sub Label4_Display(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.VisibleChanged


End Sub

Private Sub Label5_Display(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.VisibleChanged

End Sub

Private Sub Label10_Display(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.VisibleChanged



End Sub

Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click

End Sub

Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.Click

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Reset()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
ComboBox1.Text = "Select"
ComboBox2.Text = "Select"
ComboBox3.Text = "Select"
ComboBox4.Text = "Select"
Label3.Text = "$0.00"
Label4.Text = "$0.00"
Label5.Text = "$0.00"
Label10.Text = "$0.00"
End Sub
End Class



I obviously have alot to learn as this should be a pretty easy program
__________________
http://www.nothingofvalue.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hey I lost VB.net program NEED HELP MikioZen Windows .NET Programming 8 08-25-05 12:00 PM
Need quality web hosting? digitalsabotage General Advertisements 2 05-21-04 03:21 PM
($50 for........)Need to get a small project in VB.NET done in 6 hours superprogrammer Job Offers & Assistance 3 01-29-04 01:13 AM
Need help setting up Linux DNS/Firewall mzawodny Job Offers & Assistance 1 01-06-04 04:05 AM
Need Database, Need to learn how to... tag98 Job Offers & Assistance 0 11-18-03 01:05 PM


All times are GMT -5. The time now is 11:43 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.