|
Mostrar Mensajes
|
Páginas: 1 2 3 4 5 [6]
|
51
|
Programación / .NET (C#, VB.NET, ASP) / Re: no puedo desplegar todo :(
|
en: 23 Febrero 2009, 05:37 am
|
ya me salio pueden borrar este post aki el codigo correcto descubri que mi problema estaba que el for no lo cerraba con { siempre me pasa eso que torpe soy 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 desplegardiasdelasemana { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { int cont;
for (cont = 1; cont < 8; cont++) { if (cont == 1) { textBox1.Text += "lunes"+"\r\n" ; }
if (cont == 2) { textBox1.Text += "martes" + "\r\n"; }
if (cont == 3) { textBox1.Text += "miercoles"+"\r\n"; }
if (cont == 4) { textBox1.Text += "jueves" + "\r\n"; }
if (cont == 5) { textBox1.Text += "viernes" + "\r\n"; }
if (cont == 6) { textBox1.Text += "sabado" + "\r\n"; }
if (cont == 7) { textBox1.Text += "domingo" + "\r\n"; }
} }
} }
|
|
|
52
|
Programación / .NET (C#, VB.NET, ASP) / no puedo desplegar todo :(
|
en: 23 Febrero 2009, 02:41 am
|
saludos hola alguien sabe que tengo mal aki kiedo desplegar todos los dias de la semana en una texbox multiline y solo me desplega el lunes alguien me puede ayudar gracias de antemano : aki les dejo lo que ando haciendo 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 desplegardiasdelasemana { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { int cont;
for(cont = 1;cont <8;cont ++)
if(cont == 1) { textBox1.Text="lunes"; }
if (cont == 2) { textBox1.Text="Martes"; }
if (cont ==3) { textBox1.Text="Miercoles"; }
}
} }
|
|
|
53
|
Programación / .NET (C#, VB.NET, ASP) / Re: problema con otro programa :P
|
en: 23 Febrero 2009, 02:18 am
|
ya me salio gracias por su ayuda 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 diferenciade3numeroscualesmayor { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { // Declaracion de variables int m, n1, n2, n3;
//variables n1 = System.Int32.Parse(textBox1.Text); n2 = System.Int32.Parse(textBox2.Text); n3 = System.Int32.Parse(textBox3.Text);
//condiciones if (n1 > n2 && n1 > n3) { m = n1; textBox4.Text = m.ToString(); } else { if (n2 > n1 && n2 > n3) { m = n2; textBox4.Text = m.ToString(); } else { m = n3; textBox4.Text = m.ToString(); } }
}
private void button2_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); } } }
|
|
|
56
|
Programación / .NET (C#, VB.NET, ASP) / problema con otro programa :P
|
en: 21 Febrero 2009, 05:22 am
|
saludos bueno tengo un problema hice este programa para diferencia enter 2 numeros cual es el mayor pero entre 3 no se que tengo que usar exactamente espero me puedan ayudar de nuevo gracias 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 WindowsFormsApplication3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) {
//variables int n1; int n2;
//Asignacion de valores alas variables
n1 = System.Int32.Parse(textBox1.Text); n2 = System.Int32.Parse(textBox2.Text);
//condicion if (n1 > n2) textBox4.Text = n1.ToString(); else textBox4.Text = n2.ToString();
}
private void button2_Click(object sender, EventArgs e) { textBox1.Text = ""; textBox2.Text = ""; textBox4.Text = ""; textBox1.Focus();
} } }
|
|
|
57
|
Programación / .NET (C#, VB.NET, ASP) / Re: Programas en c#.net (Basico)
|
en: 21 Febrero 2009, 05:05 am
|
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace WindowsApplication1 { public partial class Frmtarea18 : Form { public Frmtarea18() { InitializeComponent(); }
private void cmdCalculo_Click(object sender, EventArgs e) { //Programa que captura tres precios en el principal, llame a una funcion que calcula //el iva del 1primer precio e imprima el 1 primer precio en el principal, se deberas hacar para le 2 segundo y 3 tercero. //modo visual //sylar
//Declaracion de variables double P1, P2, P3, Res, Res2, Res3;
//Asignacion de valor a las variables P1 = System.Int32.Parse(txtPrecio1.Text); P2 = System.Int32.Parse(txtPrecio2.Text); P3 = System.Int32.Parse(txtPrecio3.Text);
//Llamar funcion Res = Iva(P1);
//Llamar funcion Res2 = Iva2(P2);
//Llamar funcion Res3 = Iva3(P3);
//Salida de datos txtP1.Text = Res.ToString();
//Salida de datos txtP2.Text = Res2.ToString();
//Salida de datos txtP3.Text = Res3.ToString(); } //Funcion double Iva(double P1s) { //Calculo del Iva return P1s * 1.1; } //Funcion double Iva2(double P2s) { //Calculo del Iva return P2s * 1.1; } //Funcion double Iva3(double P3s) { //Calculo del iva return P3s * 1.1; }
private void cmdSalida_Click(object sender, EventArgs e) { Close(); } } }
|
|
|
58
|
Programación / .NET (C#, VB.NET, ASP) / Re: Programas en c#.net (Basico)
|
en: 20 Febrero 2009, 04:01 am
|
aqui les dejo un programilla no esta muy pro pero alguien le servira saludos using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace WindowsApplication1 { public partial class FormTarea1 : Form { public FormTarea1() { InitializeComponent(); }
private void cmdTiempo_Click(object sender, EventArgs e) { // Programa que calcule el tiempo en recorrer x distancia // by sylar
// Declaracion de las variables double Tiempo;
// calculo del Tiempo Tiempo = 60 * 1.609 / 80;
// salida del Tiempo txtTiempo.Text = Tiempo.ToString();
}
private void cmdSalida_Click(object sender, EventArgs e) { Close(); } } }
|
|
|
60
|
Programación / .NET (C#, VB.NET, ASP) / [Solucionado] Ayuda con programa :P
|
en: 20 Febrero 2009, 02:43 am
|
saludos atodos en el foro:P me dejaron hacer un programa donde use un contador y condiciones para despegar todos los dias de la semana en visual lo estoy haciendo así pero no me sale no se que me falta espero me puedan ayudar public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { int cont = 0;
//despliega resultados
if (cont == 1) textBox1.Text = "lunes"; if (cont == 2) textBox1.Text = "Martes"; if (cont == 3) textBox1.Text = "Miercoles"; if (cont == 4) textBox1.Text = "Jueves"; if (cont == 5) textBox1.Text = "Viernes"; if (cont == 6) textBox1.Text = "Sabado"; if (cont == 7) textBox1.Text = "Domingo";
}
} }
|
|
|
|
|
|
|