| | |
Problem with form
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Mar 2009
Posts: 56
Reputation:
Solved Threads: 0
Hey guys I am a newbie to VB and need help with this form,
The idea is that people enter there age and if they over 65 and are a member its one price, if they are under 65 its one price and if they are not a member it is one price. Age is entered into a textbox, memberahip is indicated by a checkbox and the price is then displayed in a textbox. Anyway I a confused about why it is not calculating. Here is what I have so far. Again I am very new to VB.
The idea is that people enter there age and if they over 65 and are a member its one price, if they are under 65 its one price and if they are not a member it is one price. Age is entered into a textbox, memberahip is indicated by a checkbox and the price is then displayed in a textbox. Anyway I a confused about why it is not calculating. Here is what I have so far. Again I am very new to VB.
VB.NET Syntax (Toggle Plain Text)
Public Class Form1 Private Sub btnPrice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrice.Click Dim getAge As Integer = txtAge.Text Dim isChecked As Integer = chkMemeber.Checked Dim showPrice As Integer = txtPrice.Text If getAge > 65 And isChecked = True Then txtPrice.Text = 5 ElseIf getAge < 65 And isChecked = True Then txtPrice.Text = 10 ElseIf isChecked = False Then txtPrice.Text = 20 End If End Sub End Class
•
•
Join Date: Mar 2009
Posts: 56
Reputation:
Solved Threads: 0
It is still not working, here is what I have:
VB.NET Syntax (Toggle Plain Text)
Public Class Form1 Private Sub btnPrice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrice.Click Dim getAge As Integer = txtAge.Text Dim isChecked As Boolean = chkMemeber.Checked If getAge > 65 And isChecked = True Then txtPrice.Text = 5 ElseIf getAge < 65 And isChecked = True Then txtPrice.Text = 10 ElseIf isChecked = False Then txtPrice.Text = 20 End If End Sub End Class
•
•
Join Date: Apr 2009
Posts: 5
Reputation:
Solved Threads: 2
0
#4 Nov 4th, 2009
line 7 correct as
and also line 9
I think it's ok
VB.NET Syntax (Toggle Plain Text)
If getAge > 65 And isChecked == True Then
and also line 9
VB.NET Syntax (Toggle Plain Text)
ElseIf getAge < 65 And isChecked == True Then
I think it's ok
•
•
Join Date: Mar 2009
Posts: 56
Reputation:
Solved Threads: 0
1
#5 Nov 4th, 2009
Its giving me an error with ==, it only accepts =
•
•
•
•
line 7 correct as
VB.NET Syntax (Toggle Plain Text)
If getAge > 65 And isChecked == True Then
and also line 9
VB.NET Syntax (Toggle Plain Text)
ElseIf getAge < 65 And isChecked == True Then
I think it's ok
•
•
Join Date: Apr 2009
Posts: 5
Reputation:
Solved Threads: 2
0
#7 Nov 5th, 2009
change line 9 as
VB.NET Syntax (Toggle Plain Text)
Dim isChecked As Boolean = chkMemeber.CheckState
![]() |
Similar Threads
- Problem in form??? (PHP)
- Netbeans problem with form (PHP)
- Problem with resetting value in form! (ASP)
- Problem in form resize (Visual Basic 4 / 5 / 6)
- Form Validation Problem (JavaScript / DHTML / AJAX)
- Problem With Form (VB.NET)
- Problem with Form and Combox selections (C#)
- I have a form problem (HTML and CSS)
- owner form display problem (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: How to print data from vb form?
- Next Thread: Create an event handler for a third party library that I use
Views: 248 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add advanced application array assignment basic box button buttons center click code combo convert cpu data database datagrid datagridview dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity page pan picturebox picturebox2 port print printing printpreview problem record regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web winsock wpf xml





