|
-
December 2nd, 2009, 08:18 PM
#1
Issues with columns
How do you put the text into columns? When my numbers get to high on my program it ignores the spaces... How do I align the text into columns? My code is here. generation, multiplier, starting are all input text boxes and Output is my output textbox.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int gen, multi, start, curgen;
double hold;
double easy = 0.0F;
if (generation.Text != null || multiplier.Text != null || starting.Text != null)
{
gen = System.Int32.Parse(generation.Text);
multi = System.Int32.Parse(multiplier.Text);
start = System.Int32.Parse(starting.Text);
double[,] total = new double[gen, 4];
Output.Text += "Starting New Run!!! \r\n";
for (curgen = 0; curgen < gen; curgen++)
{
hold = (start * multi*( Math.Pow((multi + 1),curgen)) );
total[curgen, 0] = hold;
easy += hold;
total[curgen, 1] = easy;
total[curgen, 2] = easy + start;
total[curgen, 3] = Math.Pow(multi, curgen);
Output.Text += "G " + (curgen + 1) + "\t\t" + total[curgen, 0] +"\t\t" + total[curgen, 1] + "\t\t" + total[curgen, 2] + "\t\t" + total[curgen, 3] + "\r\n";
}
}
}
private void button2_Click(object sender, EventArgs e)
{
Output.Text = " ";
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|