Foros del Web » Programación para mayores de 30 ;) » .NET »

Mostrar un msj durante un tiempo

Estas en el tema de Mostrar un msj durante un tiempo en el foro de .NET en Foros del Web. muy buenas pues lo q necesito es q cuando haga alguna accion me muestre algun mensaje durante un tiempo.....he tratado utilizando el timer de esta ...
  #1 (permalink)  
Antiguo 04/03/2010, 18:50
 
Fecha de Ingreso: junio-2008
Mensajes: 29
Antigüedad: 15 años, 9 meses
Puntos: 1
Busqueda Mostrar un msj durante un tiempo

muy buenas pues lo q necesito es q cuando haga alguna accion me muestre algun mensaje durante un tiempo.....he tratado utilizando el timer de esta manera


ProtectedSub Button1_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
If (Timer1.Interval < 60000) Then Label2.Text = "si dentro de un tiempo desaparece"Else Timer1.Enabled = False
EndSub





pero ps la verdad no me sale el texto..espero alguien m pueda orientar, pq no llevo mucho tiempo programando en .net,
si me sirve esta manera o otra..

muchas gracias
  #2 (permalink)  
Antiguo 04/03/2010, 19:45
 
Fecha de Ingreso: junio-2009
Mensajes: 117
Antigüedad: 14 años, 9 meses
Puntos: 3
Respuesta: Mostrar un msj durante un tiempo

Por lo que entendi estas haciendo, SI el intervalo del timer es menor que 1 min
entonces hacer
{
Label2.Text = "si dentro de un tiempo desaparece"
}
sino
{
Timer1.Enabled = False
}

pero el intervalo es cada cuando ahce un tick, no esta aumentando nada..si no me equivoco

bueno aca hice un pequeño ejemplo

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 WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
label1.Text = "Lo que muestra durante un timepo";
}

private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = "Cuando termina el timepo esto va en el label";
timer1.Enabled = false;
}
}
}

tenes 1 timer, 1 boton, 1 label

el timer tiene intervalo en 2 sec, durante es elapzo me va mostrar el mensaje en el label, depues muestra otra cosa, dijate en ecodigo dice lo que va depues.


espero q te ayude
  #3 (permalink)  
Antiguo 05/03/2010, 16:55
 
Fecha de Ingreso: junio-2008
Mensajes: 29
Antigüedad: 15 años, 9 meses
Puntos: 1
Respuesta: Mostrar un msj durante un tiempo

muchas gracias fue de mucha ayuda..... :D
  #4 (permalink)  
Antiguo 06/03/2010, 09:31
 
Fecha de Ingreso: junio-2009
Mensajes: 117
Antigüedad: 14 años, 9 meses
Puntos: 3
Respuesta: Mostrar un msj durante un tiempo

Buenisimo
__________________
Sitio: www.qubitek.com.ar
Uso: www.docstorus.com para mis documentos.

Etiquetas: durante
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:18.