| | |
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
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 30minutes 2005 2008 access account application arithmetic array arrays basic binary bing button buttons c# center check checkbox code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dll dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images inline insert intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project save searchbox searchvb.net select serial server soap sorting table tcp text textbox timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





