Click here to Skip to main content
15,894,955 members
Home / Discussions / C#
   

C#

 
AnswerRe: Sending bytes via internet? (info) Pin
Eddy Vluggen18-Nov-12 1:50
professionalEddy Vluggen18-Nov-12 1:50 
GeneralRe: Sending bytes via internet? (info) Pin
clonze18-Nov-12 3:54
clonze18-Nov-12 3:54 
GeneralRe: Sending bytes via internet? (info) Pin
Eddy Vluggen18-Nov-12 4:42
professionalEddy Vluggen18-Nov-12 4:42 
QuestionConverting from VB.NET Pin
Andy_L_J17-Nov-12 21:39
Andy_L_J17-Nov-12 21:39 
AnswerRe: Converting from VB.NET Pin
DaveyM6917-Nov-12 22:23
professionalDaveyM6917-Nov-12 22:23 
GeneralRe: Converting from VB.NET Pin
Andy_L_J17-Nov-12 22:54
Andy_L_J17-Nov-12 22:54 
GeneralRe: Converting from VB.NET Pin
DaveyM6918-Nov-12 7:10
professionalDaveyM6918-Nov-12 7:10 
GeneralRe: Converting from VB.NET Pin
Andy_L_J18-Nov-12 11:12
Andy_L_J18-Nov-12 11:12 
Questionfiltering column value in DevExpress grid view Pin
eli1502197917-Nov-12 20:23
eli1502197917-Nov-12 20:23 
AnswerRe: filtering column value in DevExpress grid view Pin
n.podbielski17-Nov-12 21:29
n.podbielski17-Nov-12 21:29 
Questionhelp Pin
AMIR ESLAMI17-Nov-12 9:08
AMIR ESLAMI17-Nov-12 9:08 
AnswerRe: help Pin
Eddy Vluggen17-Nov-12 9:25
professionalEddy Vluggen17-Nov-12 9:25 
AnswerRe: help Pin
Abhinav S18-Nov-12 20:58
Abhinav S18-Nov-12 20:58 
QuestionAccess to created control Pin
KKW_acd17-Nov-12 5:18
KKW_acd17-Nov-12 5:18 
AnswerRe: Access to created control Pin
DaveyM6917-Nov-12 7:30
professionalDaveyM6917-Nov-12 7:30 
QuestionHow do you programatically open a file in c# to append? Pin
Xarzu17-Nov-12 1:05
Xarzu17-Nov-12 1:05 
AnswerRe: How do you programatically open a file in c# to append? Pin
DaveyM6917-Nov-12 1:35
professionalDaveyM6917-Nov-12 1:35 
AnswerRe: How do you programatically open a file in c# to append? Pin
Eddy Vluggen17-Nov-12 9:32
professionalEddy Vluggen17-Nov-12 9:32 
QuestionC# noob: Making Textbox entry a percentage, and Help with loops Pin
maul5916-Nov-12 18:46
maul5916-Nov-12 18:46 
Hi, New here, and would be very thankful for any help someone can give me.

The code I am working for is a population estimator. It has 3 text boxes, the first is two enter the starting population, the second is to enter the daily increase in that population in a percentage, and the third is the number of days to multiply that by.

My first issue is with the second text box. I don't know how to enter the data as a percent. As of now it is only entering as a whole number, so I when I right in text box one the number 2, in box2 the number 30, and in three the number 10, I get the 302. Not 21.209 like it should be.

Secondly, it all displays in a listbox, and its supposed to loop for every day you enter. I've got the loop to loop by days, but it just runs the same calculation, I want it make every entry build off the last.
Example:
It should say
2
2.6
3.38
4.394
5.7122
etc

I've entered in the code below.
Thanks for any help!

C#
private void calculateButton_Click(object sender, EventArgs e)
       {
           int organisms;
           int days;
           int growth;
           int population;
           int count = 1;

           if (int.TryParse(OrganismsTextbox.Text, out organisms))
           {
               if (int.TryParse(DailyTextbox.Text, out growth ))

               {

                   if (int.TryParse(DaysTextbox.Text, out days))

                       do
                       {

                           population = organisms + growth * days;
                           resultsListbox.Items.Add("The population For day " + count + " is " + population.ToString("n1"));


                           count = count + 1;
                       }
                       while (count <= days);

AnswerRe: C# noob: Making Textbox entry a percentage, and Help with loops Pin
Richard MacCutchan16-Nov-12 20:43
mveRichard MacCutchan16-Nov-12 20:43 
AnswerRe: C# noob: Making Textbox entry a percentage, and Help with loops Pin
OriginalGriff16-Nov-12 21:40
mveOriginalGriff16-Nov-12 21:40 
GeneralRe: C# noob: Making Textbox entry a percentage, and Help with loops Pin
maul5916-Nov-12 22:20
maul5916-Nov-12 22:20 
GeneralRe: C# noob: Making Textbox entry a percentage, and Help with loops Pin
OriginalGriff16-Nov-12 22:26
mveOriginalGriff16-Nov-12 22:26 
QuestionInterface issue when implementing Factory pattern Pin
MichCl16-Nov-12 8:36
MichCl16-Nov-12 8:36 
AnswerRe: Interface issue when implementing Factory pattern Pin
Eddy Vluggen16-Nov-12 9:01
professionalEddy Vluggen16-Nov-12 9:01 

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.