0% found this document useful (0 votes)
9 views1 page

Ex 4

Uploaded by

keyiho4834
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Ex 4

Uploaded by

keyiho4834
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

/* *******************************************************************

* Colegio Técnico Antônio Teixeira Fernandes (Univap)


* Curso Técnico em Informática - Data de Entrega: 17/06/2024
* Autores do Projeto: João Vitor Simões
* Turma: 2J
* Atividade Proposta em aula
* Observação: <colocar se houver>
*
* Form1.cs
* ************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinFormsApp5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
int dia = int.Parse(textBox1.Text);
int mes = int.Parse(textBox2.Text);
int ano = int.Parse(textBox3.Text);
DateTime data = new DateTime(ano, mes, dia);
if (data.DayOfWeek == DayOfWeek.Saturday || data.DayOfWeek ==
DayOfWeek.Sunday)
{
label4.ForeColor = Color.Red;
}
else
{
label4.ForeColor = Color.Blue;
}

label4.Text = data.ToString("dd-MM-yyyy");

}
}
}

You might also like