473,398 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Need some programming help.

Hey guys need some help on the steps getting from one point to another.

Here is the easy part.

I have a combo box that is being loaded with 3 choices (small, medium,
large) no problem here. Then I have 6 checkboxes (red, blue, green, yellow,
white, black) no problem here.

Here is where I am hung up, which is unfortunately the biggest piece!
What I would like to do is to allow the user to choose a size and any
combination of colors and calculate the size plus the cost of each color
they choose. Then put their selection into a list box so they can see their
choices.

Any help would be appreciated! Thanks!!

Mike
Right now I can't seem to get whatever they choose for a size to turn it
into a value. Here is what I have so far.

Public Class Form1
Inherits System.Windows.Forms.Form

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Initialize combo box number
cboSize.Text = "Select Size"
cboSize.Items.Add("Select Size")
cboSize.Items.Add("Small $8.99")
cboSize.Items.Add("Medium $11.99")
cboSize.Items.Add("Large $13.99")
End Sub

Private Sub btnEnterOrder_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnEnterOrder.Click
Dim nOrder As Order
Dim nColor As Order
Dim Color As Integer
nOrder = New Order(cboSize.Text)
nColor = New Order(Color)

Select Case cboSize.Text
Case "Medium $8.99" : cboSize.Text = 8.99
Case "Large $11.99" : cboSize.Text = 11.99
Case "Gigantic $13.99" : cboSize.Text = 13.99
End Select

If chkRed.Checked Then
Color = Color + 1
End If
If chkBlue.Checked Then
Color = Color + 1
End If
If chkWhite.Checked Then
Color = Color + 1
End If
If chkBlack.Checked Then
Color = Color + 1
End If
If chkGreen.checked Then
Color = Color + 1
End If
If chkYellow.Checked Then
Color = Color + 1
End If

lstOrder.Text = nOrder.Cost 'just for testing purposes.
'lstorder will eventually show what is being ordered in
'a list so it can be printed.

End Sub
End Class
Public Class Order

Private mSize As Double
Private mColor As Integer
Public Sub New(ByVal Value As Double)
mSize = Value
End Sub

ReadOnly Property color(ByVal Value1 As Integer)
Get
mColor = Value1

End Get
End Property

Public Function Cost() As Double
Dim sCost As Double
sCost = mSize + (mColor * 0.99)
End Function
End Class

Jul 21 '05 #1
1 1117
Sorry

I fixed this!
Select Case cboSize.Text
Case "Medium $8.99" : cboSize.Text = 8.99
Case "Large $11.99" : cboSize.Text = 11.99
Case "Gigantic $13.99" : cboSize.Text = 13.99
End Select

to

Select Case cboSize.Text
Case "Small $8.99" : cboSize.Text = 8.99
Case "Medium $11.99" : cboSize.Text = 11.99
Case "Large $13.99" : cboSize.Text = 13.99
End Select

"Mike" <mi**@work.com> wrote in message
news:e7**************@TK2MSFTNGP15.phx.gbl...
Hey guys need some help on the steps getting from one point to another.

Here is the easy part.

I have a combo box that is being loaded with 3 choices (small, medium,
large) no problem here. Then I have 6 checkboxes (red, blue, green,
yellow, white, black) no problem here.

Here is where I am hung up, which is unfortunately the biggest piece!
What I would like to do is to allow the user to choose a size and any
combination of colors and calculate the size plus the cost of each color
they choose. Then put their selection into a list box so they can see
their choices.

Any help would be appreciated! Thanks!!

Mike
Right now I can't seem to get whatever they choose for a size to turn it
into a value. Here is what I have so far.

Public Class Form1
Inherits System.Windows.Forms.Form

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Initialize combo box number
cboSize.Text = "Select Size"
cboSize.Items.Add("Select Size")
cboSize.Items.Add("Small $8.99")
cboSize.Items.Add("Medium $11.99")
cboSize.Items.Add("Large $13.99")
End Sub

Private Sub btnEnterOrder_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnEnterOrder.Click
Dim nOrder As Order
Dim nColor As Order
Dim Color As Integer
nOrder = New Order(cboSize.Text)
nColor = New Order(Color)

Select Case cboSize.Text
Case "Medium $8.99" : cboSize.Text = 8.99
Case "Large $11.99" : cboSize.Text = 11.99
Case "Gigantic $13.99" : cboSize.Text = 13.99
End Select

If chkRed.Checked Then
Color = Color + 1
End If
If chkBlue.Checked Then
Color = Color + 1
End If
If chkWhite.Checked Then
Color = Color + 1
End If
If chkBlack.Checked Then
Color = Color + 1
End If
If chkGreen.checked Then
Color = Color + 1
End If
If chkYellow.Checked Then
Color = Color + 1
End If

lstOrder.Text = nOrder.Cost 'just for testing purposes.
'lstorder will eventually show what is being ordered in
'a list so it can be printed.

End Sub
End Class
Public Class Order

Private mSize As Double
Private mColor As Integer
Public Sub New(ByVal Value As Double)
mSize = Value
End Sub

ReadOnly Property color(ByVal Value1 As Integer)
Get
mColor = Value1

End Get
End Property

Public Function Cost() As Double
Dim sCost As Double
sCost = mSize + (mColor * 0.99)
End Function
End Class

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
1
by: mch2k2 | last post by:
Hello All I have just started working on Pyhton. I need urgent help regarding Python Network Programming. I want the elctronic version of the Book: Foundations of Python Network programming by...
45
by: Joh | last post by:
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = would like to produce : , , , ,
2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
4
by: Web_PDE_Eric | last post by:
I don't know where to go, or what to buy, so plz re-direct me if I'm in the wrong place. I want to do high performance integration of partial differential eqns in n dimensions (n=0,1,2,3..etc) I...
9
by: Brian Hampson | last post by:
I am trying to determine all the groups which the current user has permissions to add a member. Here's my code: foreach (System.DirectoryServices.SearchResult ADSearchres in...
5
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that...
8
by: Amar | last post by:
I am a system programmer , doing my program in C/RedHat LINUX ES4.0 version. I want to do concurrent programming in C , which will utilise my system's 4 processor simutaneously. I need some one's...
13
by: Javad | last post by:
Hello I know that I should get the information of windows internet connections by using "rasapi32.dll" library, and I also have some sample codes, but I can't make them work. My exact need is to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.