Click here to Skip to main content
15,923,681 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How do you insert a row at a time? Pin
Pradeep C27-Mar-04 5:09
Pradeep C27-Mar-04 5:09 
AnswerRe: How do you insert a row at a time? Pin
Guerven30-Mar-04 1:58
Guerven30-Mar-04 1:58 
GeneralCreating PDF writer in .net Pin
DHARMA.R25-Mar-04 22:13
DHARMA.R25-Mar-04 22:13 
GeneralRe: Creating PDF writer in .net Pin
Dave Kreskowiak26-Mar-04 2:39
mveDave Kreskowiak26-Mar-04 2:39 
GeneralRe: Creating PDF writer in .net Pin
DHARMA.R26-Mar-04 4:03
DHARMA.R26-Mar-04 4:03 
Questionant algorithm with visual basic?? Pin
pahlawan_siber25-Mar-04 20:12
pahlawan_siber25-Mar-04 20:12 
AnswerRe: ant algorithm with visual basic?? Pin
Dave Kreskowiak26-Mar-04 2:43
mveDave Kreskowiak26-Mar-04 2:43 
Generalchanging code to add subs and to call on subs Pin
ibok2325-Mar-04 15:01
ibok2325-Mar-04 15:01 
I am having to change my code so that I will have some subs and so that I can call on the subs. Here is my code for under the btncalculate button. Could anybody give me suggestions on how to put in subs and to change my code where it will still work.

Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click
        Dim amount As Single
        'Finding out how much they will be payig just for the room - with no extras.
        If radstandard.Checked = True Then
            costofroom.Text = standardrate
            costofroom.Text = Format(standardrate, "currency")


        ElseIf raddeluxe.Checked = True Then
            costofroom.Text = deluxerate
            costofroom.Text = Format(deluxerate, "currency")
        ElseIf radsuite.Checked = True Then
            costofroom.Text = suiterate
            costofroom.Text = Format(suiterate, "currency")

        End If

        'Figuring out how many days that they want the room.
        numberofdays.Text = DateDiff(DateInterval.Day, dtparrival.Value, dtpcheckout.Value) + 1

        'Finding out the cost if they need an additional bed.
        Dim newcharge As Double = rollawaybed * Val(numberofdays.Text)

        If chkbed.Checked = True Then
            rollawaybedcharge.Text = Format(newcharge, "currency")
        Else : rollawaybedcharge.Text = 0
            rollawaybedcharge.Text = Format(0, "currency")
        End If

        'Finding out how many are going to be in the room.
        'Finding out how much it is going to cost for more than 2 people in the room.
        Dim additionalguest As Double = ((nudguest.Text - 2) * 10) * Val(numberofdays.Text)


        If nudguest.Text > 2 Then
            additionalguestcharge.Text = additionalguest
            additionalguestcharge.Text = Format(additionalguest, "currency")          '((((nudguest.Text - 2) * 10) * Val(numberofdays.Text)), "currency")
        Else
            additionalguestcharge.Text = 0
            additionalguestcharge.Text = Format(0, "Currency")
        End If

        'Calculating just how much the room is going to cost with the number of Days staying there.
        subtotal.Text = ((numberofdays.Text) * (costofroom.Text))
        subtotal.Text = Format(((numberofdays.Text) * (costofroom.Text)), "currency")

        'Calculating the total for the room with everything
        total = CInt(CInt(subtotal.Text) + CInt(additionalguestcharge.Text) + CInt(rollawaybedcharge.Text))

        txttotal.Text = Format(total, "C")


I am not sure what to do. I am confused on how to do this.




End Sub

Thank you,

ibok23
GeneralRe: changing code to add subs and to call on subs Pin
ibok2325-Mar-04 15:09
ibok2325-Mar-04 15:09 
GeneralRe: changing code to add subs and to call on subs Pin
Nadroj25-Mar-04 18:14
Nadroj25-Mar-04 18:14 
GeneralRe: changing code to add subs and to call on subs Pin
ibok2326-Mar-04 2:55
ibok2326-Mar-04 2:55 
GeneralRe: changing code to add subs and to call on subs Pin
Dave Kreskowiak26-Mar-04 3:32
mveDave Kreskowiak26-Mar-04 3:32 
GeneralRe: changing code to add subs and to call on subs Pin
Dave Kreskowiak26-Mar-04 2:52
mveDave Kreskowiak26-Mar-04 2:52 
GeneralRe: changing code to add subs and to call on subs Pin
ibok2326-Mar-04 2:57
ibok2326-Mar-04 2:57 
GeneralRe: changing code to add subs and to call on subs Pin
ibok2326-Mar-04 4:36
ibok2326-Mar-04 4:36 
GeneralRe: changing code to add subs and to call on subs Pin
Nadroj26-Mar-04 4:47
Nadroj26-Mar-04 4:47 
GeneralRe: changing code to add subs and to call on subs Pin
ibok2326-Mar-04 5:09
ibok2326-Mar-04 5:09 
GeneralRe: changing code to add subs and to call on subs Pin
Nadroj26-Mar-04 6:45
Nadroj26-Mar-04 6:45 
GeneralRe: changing code to add subs and to call on subs Pin
ibok2326-Mar-04 9:21
ibok2326-Mar-04 9:21 
GeneralExceptions or Return Values Pin
Anonymous25-Mar-04 10:48
Anonymous25-Mar-04 10:48 
GeneralRe: Exceptions or Return Values Pin
Pradeep C27-Mar-04 5:44
Pradeep C27-Mar-04 5:44 
QuestionHow do I delete data?? Pin
Pugzley25-Mar-04 2:14
Pugzley25-Mar-04 2:14 
AnswerRe: How do I delete data?? Pin
Dave Kreskowiak25-Mar-04 4:15
mveDave Kreskowiak25-Mar-04 4:15 
GeneralRe: How do I delete data?? Pin
Pugzley25-Mar-04 17:35
Pugzley25-Mar-04 17:35 
GeneralRe: How do I delete data?? Pin
Dave Kreskowiak26-Mar-04 3:02
mveDave Kreskowiak26-Mar-04 3:02 

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.