Click here to Skip to main content
15,887,464 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionVb6 resource file and ms access database Pin
Otekpo Emmanuel3-Oct-15 2:29
Otekpo Emmanuel3-Oct-15 2:29 
AnswerRe: Vb6 resource file and ms access database Pin
Dave Kreskowiak3-Oct-15 4:58
mveDave Kreskowiak3-Oct-15 4:58 
GeneralRe: Vb6 resource file and ms access database Pin
Otekpo Emmanuel5-Oct-15 6:35
Otekpo Emmanuel5-Oct-15 6:35 
QuestionExcel Macros - copy & paste from one workbook to another Pin
MikeK3229-Sep-15 6:17
MikeK3229-Sep-15 6:17 
AnswerRe: Excel Macros - copy & paste from one workbook to another Pin
CHill6030-Sep-15 0:21
mveCHill6030-Sep-15 0:21 
GeneralRe: Excel Macros - copy & paste from one workbook to another Pin
MikeK3230-Sep-15 9:14
MikeK3230-Sep-15 9:14 
GeneralRe: Excel Macros - copy & paste from one workbook to another Pin
CHill6030-Sep-15 10:27
mveCHill6030-Sep-15 10:27 
QuestionPenny for Pay question Pin
BrianStrong28-Sep-15 14:10
BrianStrong28-Sep-15 14:10 
I have a problem in my programming class. A person gets paid daily, day one is 1 penny, day two is 2 pennies, day three is 4 pennies, day five is 8 pennies and so on doubling each day. I wrote the following code but am having an issue with out put. When I put in 1 day it tells me 2 pennies instead of 1. I am sure this is an easy fix but my brain is fried and I am overlooking it.

Here is my code:

Public Class Form1

Private Sub calculateButton_Click(sender As Object, e As EventArgs) Handles calculateButton.Click
Dim intDays As Integer
intDays = 1

Dim decPennies As Decimal
decPennies = 0.01

For intDays = 1 To cboDays.Text
decPennies = decPennies * 2

Next intDays
ansLabel.Text = decPennies.ToString("C")

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For intDays = 1 To 20
cboDays.Items.Add(intDays)

Next
End Sub
End Class

Any help would be greatly appreciated.
AnswerRe: Penny for Pay question Pin
Richard MacCutchan28-Sep-15 21:43
mveRichard MacCutchan28-Sep-15 21:43 
AnswerRe: Penny for Pay question Pin
Chris Quinn29-Sep-15 0:53
Chris Quinn29-Sep-15 0:53 
AnswerRe: Penny for Pay question Pin
Matt T Heffron29-Sep-15 10:35
professionalMatt T Heffron29-Sep-15 10:35 
QuestionPlease explain this. Pin
Member 1201796828-Sep-15 11:40
Member 1201796828-Sep-15 11:40 
AnswerRe: Please explain this. Pin
Dave Kreskowiak28-Sep-15 12:22
mveDave Kreskowiak28-Sep-15 12:22 
QuestionImport data from photon Pin
Member 1051522527-Sep-15 19:10
professionalMember 1051522527-Sep-15 19:10 
Questionconverting a embedded xml file resource to a xml object Pin
jkirkerx23-Sep-15 9:51
professionaljkirkerx23-Sep-15 9:51 
Answer[Cancel That] Pin
jkirkerx23-Sep-15 11:36
professionaljkirkerx23-Sep-15 11:36 
QuestionEmbedded Windows Media Player stream playing query Pin
Magrat23-Sep-15 8:26
Magrat23-Sep-15 8:26 
QuestionHOw I can find a sent mail with vba? Pin
Member 1199849020-Sep-15 13:21
Member 1199849020-Sep-15 13:21 
AnswerRe: HOw I can find a sent mail with vba? Pin
Dave Kreskowiak25-Sep-15 14:56
mveDave Kreskowiak25-Sep-15 14:56 
QuestionCan radio buttons have more than 1 function? Pin
Member 1199784020-Sep-15 3:55
Member 1199784020-Sep-15 3:55 
SuggestionRe: Can radio buttons have more than 1 function? Pin
Maciej Los20-Sep-15 5:32
mveMaciej Los20-Sep-15 5:32 
GeneralRe: Can radio buttons have more than 1 function? Pin
Member 1199784020-Sep-15 5:46
Member 1199784020-Sep-15 5:46 
GeneralRe: Can radio buttons have more than 1 function? Pin
Maciej Los20-Sep-15 5:59
mveMaciej Los20-Sep-15 5:59 
QuestionNavigating folders in listview. Pin
GeekyGirlPanacea17-Sep-15 0:29
GeekyGirlPanacea17-Sep-15 0:29 
AnswerRe: Navigating folders in listview. Pin
Brisingr Aerowing17-Sep-15 0:48
professionalBrisingr Aerowing17-Sep-15 0:48 

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.