Click here to Skip to main content
15,897,315 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: TextBox Format Pin
internetuser2k1120-Nov-11 0:41
internetuser2k1120-Nov-11 0:41 
GeneralRe: TextBox Format Pin
Luc Pattyn20-Nov-11 10:01
sitebuilderLuc Pattyn20-Nov-11 10:01 
GeneralRe: TextBox Format Pin
internetuser2k1120-Nov-11 18:13
internetuser2k1120-Nov-11 18:13 
GeneralRe: TextBox Format Pin
internetuser2k1121-Nov-11 5:03
internetuser2k1121-Nov-11 5:03 
AnswerRe: TextBox Format Pin
Luc Pattyn19-Nov-11 23:25
sitebuilderLuc Pattyn19-Nov-11 23:25 
Questionuse a custom function inside entity framework query Pin
alejx15-Nov-11 5:12
alejx15-Nov-11 5:12 
AnswerRe: use a custom function inside entity framework query Pin
DaveAuld19-Nov-11 2:52
professionalDaveAuld19-Nov-11 2:52 
QuestionHelp with Visual Basic Plz Pin
Member 840169014-Nov-11 11:28
Member 840169014-Nov-11 11:28 
i made this program
screenshot link - http://s10.postimage.org/jv5dvf17b/help.jpg

got up to here...
VB
Private Sub computeBtn_Click(sender As System.Object, e As System.EventArgs) Handles computeBtn.Click
    Dim sum As Double = 0
    If regularRadio.Checked Then
        sum += 4.19
    End If
    If cheeseRadio.Checked Then
        sum += 4.79
    End If
    If baconRadio.Checked Then
        sum += 4.79
    End If

    If cheesebaconRadio.Checked Then
        sum += 5.39
    End If

    If smallRadio.Checked Then
        sum += 2.39
    End If
    If mediumRadio.Checked Then
        sum += 3.09
    End If
    If largeRadio.Checked Then
        sum += 4.99
    End If
    If sodaRadio.Checked Then
        sum += 1.69
    End If
    If waterRadio.Checked Then
        sum += 1.49
    End If
    txtCost.Text = FormatCurrency(sum)


End Sub

how do i
1.
Get the price for each item to be extracted from the form itself (not hard-coded as constants) using string methods.
2. make a function, lets say called extractPrice() that has
One String input argument (the text label from one of the form's radio buttons)
One Double output argument (the extracted price, converted from text to a double).
Returns True if the price was successfully extracted from the input string, otherwise, False (similar to TryParse() )
3.
Create a function called Price(), that has
One String input argument (the text label from one of the form's radio buttons)
It returns a numeric value that is the price for that item.
The function has a side-affect. If the price can't be found in the string, or it can't be translated into a proper number,
the program should clearly explain the error to the owners so that they can correct the problem, and then,
terminate the program immediately, using a Me.Close().
4.
Add a groupbox to the upper right hand corner of the form, that contains two buttons.
A "Test Each Price on Form" button, which, when clicked on, will cycle through each radio button on the form, passing the Text associated with the radio button to extractPrice(), to make the price within the string can be extracted.
Display any strings that caused extractPrice() to return False in a MessageBox(), telling the owner that this label needs to be corrected.
Continue testing the text from the remaining radio buttons, even after extractPrice() returns False. That is, don't quit if one fails.

Any help would mean alot thanks!
AnswerRe: Help with Visual Basic Plz Pin
Luc Pattyn14-Nov-11 12:01
sitebuilderLuc Pattyn14-Nov-11 12:01 
GeneralRe: Help with Visual Basic Plz Pin
Member 840169014-Nov-11 15:42
Member 840169014-Nov-11 15:42 
AnswerRe: Help with Visual Basic Plz Pin
internetuser2k1120-Nov-11 1:10
internetuser2k1120-Nov-11 1:10 
QuestionVB.Net Web Services - SharePoint not filtering records and fields in results set Pin
Member 840105014-Nov-11 7:26
Member 840105014-Nov-11 7:26 
QuestionVB.Global Printers Pin
Shyvmir14-Nov-11 4:36
Shyvmir14-Nov-11 4:36 
QuestionRe: VB.Global Printers Pin
Eddy Vluggen14-Nov-11 9:15
professionalEddy Vluggen14-Nov-11 9:15 
AnswerRe: VB.Global Printers Pin
Shyvmir22-Nov-11 20:40
Shyvmir22-Nov-11 20:40 
Questioninclude controls in EF query Pin
alejx14-Nov-11 0:41
alejx14-Nov-11 0:41 
AnswerRe: include controls in EF query Pin
Eddy Vluggen14-Nov-11 9:07
professionalEddy Vluggen14-Nov-11 9:07 
GeneralRe: include controls in EF query Pin
alejx14-Nov-11 11:11
alejx14-Nov-11 11:11 
GeneralRe: include controls in EF query Pin
Eddy Vluggen14-Nov-11 11:59
professionalEddy Vluggen14-Nov-11 11:59 
GeneralRe: include controls in EF query Pin
alejx14-Nov-11 12:21
alejx14-Nov-11 12:21 
AnswerRe: include controls in EF query Pin
Eddy Vluggen15-Nov-11 5:33
professionalEddy Vluggen15-Nov-11 5:33 
QuestionTHX for ALL OF YOU_ Pin
princeza aurora nada13-Nov-11 19:01
princeza aurora nada13-Nov-11 19:01 
Questionany one...please teach me about VB...please_"( Pin
princeza aurora nada10-Nov-11 9:43
princeza aurora nada10-Nov-11 9:43 
AnswerRe: any one...please teach me about VB...please_"( Pin
Eddy Vluggen10-Nov-11 9:54
professionalEddy Vluggen10-Nov-11 9:54 
GeneralRe: any one...please teach me about VB...please_"( Pin
princeza aurora nada13-Nov-11 18:44
princeza aurora nada13-Nov-11 18:44 

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.