using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace Planyvalnuk
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.NumericUpDown numericUpDown2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.DateTimePicker dateTimePicker2;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.ContextMenu contextMenu1;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
public System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.MenuItem menuItem7;
private System.Windows.Forms.MenuItem menuItem6;
private System.Windows.Forms.MenuItem menuItem8;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem7 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.listBox1 = new System.Windows.Forms.ListBox();
this.button1 = new System.Windows.Forms.Button();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.button2 = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.contextMenu1 = new System.Windows.Forms.ContextMenu();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.button3 = new System.Windows.Forms.Button();
this.menuItem8 = new System.Windows.Forms.MenuItem();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.SuspendLayout();
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem7,
this.menuItem6,
this.menuItem8});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem3});
this.menuItem1.Text = "Записи";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "Продивитись";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "Створити";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// menuItem7
//
this.menuItem7.Index = 1;
this.menuItem7.Text = "Закрити всі меню";
this.menuItem7.Click += new System.EventHandler(this.menuItem7_Click);
//
// menuItem6
//
this.menuItem6.Index = 2;
this.menuItem6.Text = "Нотатник";
this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click);
//
// listBox1
//
this.listBox1.BackColor = System.Drawing.SystemColors.InactiveBorder;
this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.listBox1.ForeColor = System.Drawing.SystemColors.InfoText;
this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(0, 0);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(496, 288);
this.listBox1.TabIndex = 0;
this.listBox1.Visible = false;
//
// button1
//
this.button1.Cursor = System.Windows.Forms.Cursors.Hand;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.button1.Image = ((System.Drawing.Image)(resources.GetObject("button1.Image")));
this.button1.Location = new System.Drawing.Point(520, 336);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(248, 56);
this.button1.TabIndex = 1;
this.button1.Visible = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
this.button1.MouseEnter += new System.EventHandler(this.button1_MouseEnter);
this.button1.MouseLeave += new System.EventHandler(this.button1_MouseLeave);
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(552, 56);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(176, 20);
this.dateTimePicker1.TabIndex = 2;
this.dateTimePicker1.Visible = false;
//
// numericUpDown1
//
this.numericUpDown1.BackColor = System.Drawing.SystemColors.Control;
this.numericUpDown1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.numericUpDown1.ForeColor = System.Drawing.SystemColors.ControlText;
this.numericUpDown1.Location = new System.Drawing.Point(528, 104);
this.numericUpDown1.Maximum = new System.Decimal(new int[] {
23,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(40, 22);
this.numericUpDown1.TabIndex = 3;
this.numericUpDown1.Visible = false;
//
// numericUpDown2
//
this.numericUpDown2.BackColor = System.Drawing.SystemColors.Control;
this.numericUpDown2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.numericUpDown2.ForeColor = System.Drawing.SystemColors.ControlText;
this.numericUpDown2.Location = new System.Drawing.Point(632, 104);
this.numericUpDown2.Maximum = new System.Decimal(new int[] {
59,
0,
0,
0});
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(48, 22);
this.numericUpDown2.TabIndex = 4;
this.numericUpDown2.Visible = false;
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.label1.Location = new System.Drawing.Point(568, 104);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 24);
this.label1.TabIndex = 5;
this.label1.Text = "Годин";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label1.Visible = false;
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.label2.Location = new System.Drawing.Point(688, 104);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 24);
this.label2.TabIndex = 6;
this.label2.Text = "Хвилин";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label2.Visible = false;
//
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.label3.Location = new System.Drawing.Point(536, 8);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(168, 32);
this.label3.TabIndex = 7;
this.label3.Text = "Виберіть число і час для нагадування";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label3.Visible = false;
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.SystemColors.Info;
this.textBox1.Location = new System.Drawing.Point(520, 192);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(248, 120);
this.textBox1.TabIndex = 8;
this.textBox1.Text = "";
this.textBox1.Visible = false;
//
// label4
//
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.label4.Location = new System.Drawing.Point(528, 144);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(216, 40);
this.label4.TabIndex = 9;
this.label4.Text = "Введіть текст";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label4.Visible = false;
//
// dateTimePicker2
//
this.dateTimePicker2.Location = new System.Drawing.Point(80, 344);
this.dateTimePicker2.Name = "dateTimePicker2";
this.dateTimePicker2.Size = new System.Drawing.Size(160, 20);
this.dateTimePicker2.TabIndex = 10;
this.dateTimePicker2.Visible = false;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// button2
//
this.button2.Cursor = System.Windows.Forms.Cursors.Hand;
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.button2.Image = ((System.Drawing.Image)(resources.GetObject("button2.Image")));
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
this.button2.Location = new System.Drawing.Point(8, 352);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(472, 48);
this.button2.TabIndex = 12;
this.button2.Visible = false;
this.button2.Click += new System.EventHandler(this.button2_Click);
this.button2.MouseEnter += new System.EventHandler(this.button2_MouseEnter);
this.button2.MouseLeave += new System.EventHandler(this.button2_MouseLeave);
//
// label5
//
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.label5.Location = new System.Drawing.Point(536, 8);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(208, 32);
this.label5.TabIndex = 13;
this.label5.Text = "Текст повідомлення";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label5.Visible = false;
//
// textBox2
//
this.textBox2.BackColor = System.Drawing.SystemColors.Info;
this.textBox2.Location = new System.Drawing.Point(512, 40);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(256, 248);
this.textBox2.TabIndex = 14;
this.textBox2.Text = "";
this.textBox2.Visible = false;
//
// contextMenu1
//
this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem4,
this.menuItem5});
//
// menuItem4
//
this.menuItem4.Index = 0;
this.menuItem4.Text = "Відновити";
this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
//
// menuItem5
//
this.menuItem5.Index = 1;
this.menuItem5.Text = "Вийти з програми";
this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
//
// notifyIcon1
//
this.notifyIcon1.ContextMenu = this.contextMenu1;
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
//
// button3
//
this.button3.Cursor = System.Windows.Forms.Cursors.Hand;
this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.button3.Image = ((System.Drawing.Image)(resources.GetObject("button3.Image")));
this.button3.Location = new System.Drawing.Point(8, 296);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(472, 48);
this.button3.TabIndex = 16;
this.button3.Visible = false;
this.button3.Click += new System.EventHandler(this.button3_Click);
this.button3.MouseEnter += new System.EventHandler(this.button3_MouseEnter);
this.button3.MouseLeave += new System.EventHandler(this.button3_MouseLeave);
//
// menuItem8
//
this.menuItem8.Index = 3;
this.menuItem8.Text = "Допомога";
this.menuItem8.Click += new System.EventHandler(this.menuItem8_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.BackColor = System.Drawing.Color.DarkSeaGreen;
this.ClientSize = new System.Drawing.Size(786, 408);
this.Controls.Add(this.button3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label5);
this.Controls.Add(this.button2);
this.Controls.Add(this.dateTimePicker2);
this.Controls.Add(this.label4);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.numericUpDown2);
this.Controls.Add(this.numericUpDown1);
this.Controls.Add(this.dateTimePicker1);
this.Controls.Add(this.button1);
this.Controls.Add(this.listBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "Планувальник";
this.TransparencyKey = System.Drawing.Color.Red;
this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
string[] all=Directory.GetFiles("DATA/");
for(int i=0;i<all.Length;i++)
{
StreamReader sr=new StreamReader(all[i]);
string sqr=sr.ReadToEnd();
string del2=all[i];
sr.Close();
all[i]=all[i].Replace("DATA/","");
all[i]=all[i].Replace(".txt","");
string[] spl=all[i].Split(new char[] {'.'});
listBox1.Items.AddRange(new object[1] {spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr});
if(Convert.ToInt32(spl[4])<dateTimePicker2.Value.Year)
{
MessageBox.Show("Пропущене повідомлення: "+sqr);
File.Delete(del2);
listBox1.Items.Remove(spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr);
}
else if(Convert.ToInt32(spl[4])==dateTimePicker2.Value.Year)
{
if(Convert.ToInt32(spl[3])<dateTimePicker2.Value.Month)
{
MessageBox.Show("Пропущене повідомлення: "+sqr);
File.Delete(del2);
listBox1.Items.Remove(spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr);
}
else if(Convert.ToInt32(spl[3])==dateTimePicker2.Value.Month)
{
if(Convert.ToInt32(spl[2])<dateTimePicker2.Value.Day)
{
MessageBox.Show("Пропущене повідомлення: "+sqr);
File.Delete(del2);
listBox1.Items.Remove(spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr);
}
else if(Convert.ToInt32(spl[2])==dateTimePicker2.Value.Day)
{
if(Convert.ToInt32(spl[1])<dateTimePicker2.Value.Hour)
{
MessageBox.Show("Пропущене повідомлення: "+sqr);
File.Delete(del2);
listBox1.Items.Remove(spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr);
}
else if(Convert.ToInt32(spl[1])==dateTimePicker2.Value.Hour)
{
if(Convert.ToInt32(spl[0])<dateTimePicker2.Value.Minute)
{
MessageBox.Show("Пропущене повідомлення: "+sqr);
File.Delete(del2);
listBox1.Items.Remove(spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr);
}
}
}
}
}
}
}
private void button1_Click(object sender, System.EventArgs e)
{
try
{
string s="DATA/"+numericUpDown2.Value.ToString()+"."+numericUpDown1.Value.ToString()+"."+dateTimePicker1.Value.Day.ToString()+"."+dateTimePicker1.Value.Month.ToString()+"."+dateTimePicker1.Value.Year.ToString();
StreamWriter zapus=new StreamWriter(s+".txt");
zapus.Write(textBox1.Text);
zapus.Close();
listBox1.Items.AddRange(new object[1] {numericUpDown2.Value.ToString()+" хвилин(а) "+numericUpDown1.Value.ToString()+" годин(а) "+dateTimePicker1.Value.Day.ToString()+" день "+dateTimePicker1.Value.Month.ToString()+" місяць "+dateTimePicker1.Value.Year.ToString()+" рік "+" текст повідомлення: "+textBox1.Text});
numericUpDown2.Value=0;
numericUpDown1.Value=0;
MessageBox.Show("Збереженно");
}
catch
{
MessageBox.Show("Нажаль такий час вже існує - задайте інший час");
}
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
listBox1.Visible=true;
button2.Visible=true;
textBox1.Visible=false;
label4.Visible=false;
button1.Visible=false;
numericUpDown1.Visible=false;
numericUpDown2.Visible=false;
label1.Visible=false;
label2.Visible=false;
label3.Visible=false;
label5.Visible=true;
textBox2.Visible=true;
dateTimePicker1.Visible=false;
button3.Visible=true;
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
listBox1.Visible=true;
textBox1.Visible=true;
label4.Visible=true;
button1.Visible=true;
numericUpDown1.Visible=true;
numericUpDown2.Visible=true;
label1.Visible=true;
label2.Visible=true;
label3.Visible=true;
dateTimePicker1.Visible=true;
label5.Visible=false;
textBox2.Visible=false;
button2.Visible=false;
button3.Visible=false;
}
private void timer1_Tick(object sender, System.EventArgs e)
{
string[] all=Directory.GetFiles("DATA/");
for(int i=0;i<all.Length;i++)
{
string del=all[i];
StreamReader sr=new StreamReader(all[i]);
string sqr=sr.ReadToEnd();
sr.Close();
all[i]=all[i].Replace("DATA/","");
all[i]=all[i].Replace(".txt","");
string[] spl=all[i].Split(new char[] {'.'});
if((spl[0]==dateTimePicker2.Value.Minute.ToString())&&(spl[1]==dateTimePicker2.Value.Hour.ToString())&&(spl[2]==dateTimePicker2.Value.Day.ToString())&&(spl[3]==dateTimePicker2.Value.Month.ToString())&&(spl[4]==dateTimePicker2.Value.Year.ToString()))
{
File.Delete(del);
MessageBox.Show(sqr);
listBox1.Items.Remove(spl[0]+" хвилин(а) "+spl[1]+" годин(а) "+spl[2]+" день "+spl[3]+" місяць "+spl[4]+" рік "+" текст повідомлення: "+sqr);
break;
}
}
}
private void button2_Click(object sender, System.EventArgs e)
{
try
{
listBox1.Items.Remove(listBox1.SelectedItem);
string ss=textBox2.Text;
ss=ss.Remove(0,1);
textBox2.Text="";
string[] ss1=Directory.GetFiles("DATA/");
for(int i=0;i<ss1.Length;i++)
{
StreamReader sr=new StreamReader(ss1[i]);
if(ss==sr.ReadLine())
{
sr.Close();
File.Delete(ss1[i]);
break;
}
}
}
catch
{
MessageBox.Show("повідомленнь немає");
}
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel=true;
this.Visible=false;
}
private void menuItem5_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
private void menuItem4_Click(object sender, System.EventArgs e)
{
this.Visible=true;
}
private void button3_Click(object sender, System.EventArgs e)
{
try
{
string si=listBox1.SelectedItem.ToString();
int ir=si.IndexOf(":");
si=si.Remove(0,ir+1);
textBox2.Text=si;
}
catch
{
MessageBox.Show("повідомленнь немає");
}
}
private void menuItem7_Click(object sender, System.EventArgs e)
{
label1.Visible=false;
label2.Visible=false;
label3.Visible=false;
label4.Visible=false;
label5.Visible=false;
button1.Visible=false;
button2.Visible=false;
button3.Visible=false;
textBox1.Visible=false;
textBox2.Visible=false;
numericUpDown1.Visible=false;
numericUpDown2.Visible=false;
dateTimePicker1.Visible=false;
listBox1.Visible=false;
}
private void menuItem6_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process.Start("WindowsApplication1.exe");
}
private void button2_MouseEnter(object sender, System.EventArgs e)
{
button2.FlatStyle=FlatStyle.Popup;
}
private void button2_MouseLeave(object sender, System.EventArgs e)
{
button2.FlatStyle=FlatStyle.Standard;
}
private void button3_MouseEnter(object sender, System.EventArgs e)
{
button3.FlatStyle=FlatStyle.Popup;
}
private void button3_MouseLeave(object sender, System.EventArgs e)
{
button3.FlatStyle=FlatStyle.Standard;
}
private void button1_MouseEnter(object sender, System.EventArgs e)
{
button1.FlatStyle=FlatStyle.Popup;
}
private void button1_MouseLeave(object sender, System.EventArgs e)
{
button1.FlatStyle=FlatStyle.Standard;
}
private void menuItem8_Click(object sender, System.EventArgs e)
{
System.Diagnostics.Process.Start("HELP/Текстовый документ.html");
}
}
}