martes, 4 de junio de 2013

YOLO

namespace WindowsFormsApplication1



{
public partial class Form1 : Form



{
public Form1()



{

InitializeComponent();

}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)



{

}
private void button1_Click(object sender, EventArgs e)



{

dataGridView1.Rows.Clear();
Random r = new Random();

int limite = int.Parse(textBox1.Text);

int[] numeros = new int[limite];

for (int a = 0; a < limite; a++)



{

numeros[a] = r.Next(1, 99);
if (a > 0)



{
for (int w = 0; w < 0; w++)



{
for (int d = 0; d < a; d++)



{

numeros[a] = numeros[d];

{

numeros[a] = r.Next(1, 99);

}

}

}

}

}
for (int a = 0; a < limite; a++)



dataGridView1.Rows.Add(a + 1, numeros[a]);

}
private void button2_Click(object sender, EventArgs e)



{
DataGridViewColumnCollection cc = dataGridView1.Columns;

DataGridViewColumn Column1 = cc.GetFirstColumn(DataGridViewElementStates.Visible);

DataGridViewColumn Column2 = cc.GetLastColumn(DataGridViewElementStates.Visible, DataGridViewElementStates.None);

int Cc1 = Column1.DisplayIndex;



Column1.DisplayIndex = Column2.DisplayIndex;

Column2.DisplayIndex = Cc1;

}

}

}