Click here to Skip to main content
12,631,963 members (30,909 online)

Visual Basic

 
GeneralRe: Securing application password Pin
DisIsHoody12-Oct-12 10:28
memberDisIsHoody12-Oct-12 10:28 
GeneralRe: Securing application password Pin
Matty2212-Oct-12 14:53
memberMatty2212-Oct-12 14:53 
GeneralRe: Securing application password Pin
DisIsHoody12-Oct-12 19:59
memberDisIsHoody12-Oct-12 19:59 
QuestionVB6 Project - Printing Press Management System Pin
Mahesh KL3-Oct-12 6:58
memberMahesh KL3-Oct-12 6:58 
AnswerRe: VB6 Project - Printing Press Management System Pin
Dave Kreskowiak3-Oct-12 14:39
mvpDave Kreskowiak3-Oct-12 14:39 
AnswerRe: VB6 Project - Printing Press Management System Pin
Eddy Vluggen3-Oct-12 23:49
memberEddy Vluggen3-Oct-12 23:49 
SuggestionRe: VB6 Project - Printing Press Management System Pin
Joan Murt4-Oct-12 1:47
memberJoan Murt4-Oct-12 1:47 
QuestionWorking from scratch based on created application Pin
Herboren3-Oct-12 6:49
memberHerboren3-Oct-12 6:49 
I have a teacher who gave us a compiled application. He did not provide us the code. We have to generate the code in our head and write it out. It must act like his application in every possible way. I have it written out but for some reason when I type in the value of two(2) pieces the two(2) isn't calculated yet every other number I type calculates just fine. Why?

two(2) falls within range of 1-199 so its price would be calculated as rangeA * two(2) pieces = price for two, but no result is returned, my text does not display in the textbox either.

 Dim priceArrayElements(20) As Decimal ' Store Prices calculated, 21 count
    Dim pieceArrayElements(20) As Integer ' Store Pieces counted, 21 count

    Dim addedPieces ' Total of all Piece elements added together
    Dim totalAveragePieces ' Average of Piece elements added together / element count

    Dim addedPrices As Decimal ' Total of all price elements added together
    Dim totalAveragePrices As Decimal ' Average of Price elements added together / element count

    Dim elementCounter As Decimal ' Global Counter for both arrays

    Dim rangeA As Decimal = 0.5  ' Price applies to range   1 - 199
    Dim rangeB As Decimal = 0.55 ' Price applies to range 200 - 399
    Dim rangeC As Decimal = 0.6  ' Price applies to range 400 - 599
    Dim rangeD As Decimal = 0.65 ' Price applies to range 600 - >

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Select Case False
            Case IsNumeric(txtPieces.Text)
                MessageBox.Show("Pieces completed must be numeric.", "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
                txtPieces.Text = ""

            Case Not IsNumeric(txtName.Text)
                MessageBox.Show("Name is required.", "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Information)
                txtName.Text = ""

            Case Else

                Select Case txtPieces.Text
                    Case 1 To 199
                        Try
                            For i As Integer = 0 To priceArrayElements.Length
                                priceArrayElements(i) = (Decimal.Parse(txtPieces.Text) * rangeA)
                                txtEarned.Text = FormatCurrency(priceArrayElements(i).ToString())
                            Next
                        Catch ex As Exception
                            'Supress Message
                        End Try
                    Case 200 To 399
                        Try
                            For i As Integer = 0 To priceArrayElements.Length
                                priceArrayElements(i) = (Decimal.Parse(txtPieces.Text) * rangeB)
                                txtEarned.Text = FormatCurrency(priceArrayElements(i).ToString())
                            Next
                        Catch ex As Exception
                            'Supress Message
                        End Try
                    Case 400 To 599
                        Try
                            For i As Integer = 0 To priceArrayElements.Length
                                priceArrayElements(i) = (Decimal.Parse(txtPieces.Text) * rangeC)
                                txtEarned.Text = FormatCurrency(priceArrayElements(i).ToString())
                            Next
                        Catch ex As Exception
                            'Supress Message
                        End Try
                    Case Else
                        If Int32.Parse(txtPieces.Text) >= 600 Then
                            Try
                                For i As Integer = 0 To priceArrayElements.Length
                                    priceArrayElements(i) = (Decimal.Parse(txtPieces.Text) * rangeD)
                                    txtEarned.Text = FormatCurrency(priceArrayElements(i).ToString())
                                Next
                            Catch ex As Exception
                                'Supress Message
                            End Try
                        End If
                End Select

        End Select

    End Sub

End Class

AnswerRe: Working from scratch based on created application Pin
Eddy Vluggen3-Oct-12 23:46
memberEddy Vluggen3-Oct-12 23:46 
AnswerRe: Working from scratch based on created application Pin
DisIsHoody11-Oct-12 20:02
memberDisIsHoody11-Oct-12 20:02 
QuestionHow may I add a MDITabControl to my project (VB2008) Pin
Member 16752941-Oct-12 5:56
memberMember 16752941-Oct-12 5:56 
AnswerRe: How may I add a MDITabControl to my project (VB2008) Pin
Eddy Vluggen1-Oct-12 6:14
memberEddy Vluggen1-Oct-12 6:14 
QuestionLOAD CSV FILES TO VB 8 Pin
memas6328-Sep-12 7:32
membermemas6328-Sep-12 7:32 
AnswerRe: LOAD CSV FILES TO VB 8 Pin
Dave Kreskowiak28-Sep-12 8:03
mvpDave Kreskowiak28-Sep-12 8:03 
QuestionSOAP service responding with partial data Pin
loctrice28-Sep-12 6:17
memberloctrice28-Sep-12 6:17 
AnswerRe: SOAP service responding with partial data Pin
Dave Kreskowiak28-Sep-12 8:01
mvpDave Kreskowiak28-Sep-12 8:01 
GeneralRe: SOAP service responding with partial data Pin
loctrice28-Sep-12 8:03
memberloctrice28-Sep-12 8:03 
GeneralRe: SOAP service responding with partial data Pin
Dave Kreskowiak28-Sep-12 8:14
mvpDave Kreskowiak28-Sep-12 8:14 
QuestionVB 2005 Datagridview print Pin
Nigel14227-Sep-12 20:34
memberNigel14227-Sep-12 20:34 
AnswerRe: VB 2005 Datagridview print Pin
Richard MacCutchan27-Sep-12 22:56
mvpRichard MacCutchan27-Sep-12 22:56 
QuestionHow can I distribute a VB6 application with NSIS? Pin
fancyRocko27-Sep-12 3:08
memberfancyRocko27-Sep-12 3:08 
AnswerRe: How can I distribute a VB6 application with NSIS? Pin
Dave Kreskowiak27-Sep-12 14:38
mvpDave Kreskowiak27-Sep-12 14:38 
GeneralRe: How can I distribute a VB6 application with NSIS? Pin
fancyRocko27-Sep-12 23:49
memberfancyRocko27-Sep-12 23:49 
GeneralRe: How can I distribute a VB6 application with NSIS? Pin
Eddy Vluggen28-Sep-12 0:03
memberEddy Vluggen28-Sep-12 0:03 
GeneralRe: How can I distribute a VB6 application with NSIS? Pin
Dave Kreskowiak28-Sep-12 2:16
mvpDave Kreskowiak28-Sep-12 2:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.161208.1 | Last Updated 8 Dec 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid