StevanovicMilan

Vežba 07, Zadatak 2

Dec 1st, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Vezba_07_2017
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void Form1_Load(object sender, EventArgs e)
  21.         {
  22.             DateTime dt;
  23.             dt = DateTime.Now;
  24.             DateTime ny = new DateTime(dt.Year + 1, 1, 1);
  25.             int brDana = (ny - dt).Days;
  26.  
  27.             textBox1.Text = String.Format("{0:F}", dt);
  28.             textBox2.Text = String.Format("{0:D}", dt);
  29.             textBox3.Text = String.Format("{0:d}", dt);
  30.             textBox4.Text = String.Format("{0:g}", dt);
  31.             textBox5.Text = String.Format("{0:T}", dt);
  32.             textBox6.Text = String.Format("{0:t}", dt);
  33.             textBox7.Text = brDana.ToString();
  34.  
  35.         }
  36.  
  37.         private void button1_Click(object sender, EventArgs e)
  38.         {
  39.             DateTime dt;
  40.             dt = DateTime.Now;
  41.             DateTime ny = new DateTime(dt.Year + 1, 1, 1);
  42.             int brDana = (ny - dt).Days;
  43.  
  44.             textBox1.Text = String.Format("{0:F}", dt);
  45.             textBox2.Text = String.Format("{0:D}", dt);
  46.             textBox3.Text = String.Format("{0:d}", dt);
  47.             textBox4.Text = String.Format("{0:g}", dt);
  48.             textBox5.Text = String.Format("{0:T}", dt);
  49.             textBox6.Text = String.Format("{0:t}", dt);
  50.             textBox7.Text = brDana.ToString();
  51.         }
  52.  
  53.         private void button2_Click(object sender, EventArgs e)
  54.         {
  55.             Close();
  56.         }
  57.     }
  58. }
Add Comment
Please, Sign In to add comment