Exemplo n.º 1
0
        private void mensagemToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            FrmMensagem frm = new FrmMensagem();

            frm.MdiParent = this;
            frm.Text      = "Janela " + childFormNumber++;
            frm.Show();
        }
Exemplo n.º 2
0
 private void btnCadCliente_Click(object sender, EventArgs e)
 {
     using (FrmMensagem frm = new FrmMensagem())
     {
         frm.ShowDialog();
         int CodSelec = Convert.ToInt32(cbMensagem.SelectedValue);
         GetDropMensagem();
         cbMensagem.SelectedValue = CodSelec;
     }
 }
Exemplo n.º 3
0
 private void Loop()
 {
     string noticiaNova = "";
     for (;;)
     {
         //Tenta resgatar as notícas 2 vezes pois pode ser que em uma dê problema de conexão
         try
         {
             Neopocket.News.News news = new Neopocket.News.News();
             try
             {
                 noticiaNova = news.GetNews();
             }
             catch
             {
                 try
                 {
                     Thread.Sleep(5000);
                     noticiaNova = news.GetNews();
                 }
                 catch(Exception ex){
                     string erro = ex.Message;
                 }
             }
             //noticiaNova = "olá";
             if (noticiaNova != noticia && noticiaNova != "")
             {
                 noticia = noticiaNova;
                 if (frmMensagem != null)
                 {
                     frmMensagem.Close();
                     frmMensagem = null;
                 }
                 if (noticiasAnteriores == "")
                 {
                     noticiaASerMostrada = noticia + Environment.NewLine + Environment.NewLine + noticiasAnteriores;
                     noticiasAnteriores = noticia;
                 }
                 else
                 {
                     noticiaASerMostrada = noticia + Environment.NewLine + Environment.NewLine + noticiasAnteriores;
                     noticiasAnteriores = noticia + Environment.NewLine + Environment.NewLine + noticiasAnteriores;
                 }
                 Neopocket.Lib.Sound snd = new Neopocket.Lib.Sound();
                 snd.PlayNotify();
                 frmMensagem = new FrmMensagem(noticiaASerMostrada);
                 frmMensagem.DeveEstarNoTopo = true;
                 frmMensagem.ShowDialog();
                 frmMensagem.DeveEstarNoTopo = false;
     //                        Util.FormExibirDialog(new FrmMensagem(noticiaASerMostrada));
             }
         }
         catch { }
         Thread.Sleep((int) (minutosEntreChecagens * 60 * 1000));
     }// Fim for
 }