Результат работы программы
Практическая работа №2
Тема: «Создание простейшего Windows Application проекта»
Листинг программы
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 Интерфейс_п_р_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(this, "Hello, World C#!");
}
}
}
Результат работы программы
Практическая работа №3
Тема: «Создание меню»
Листинг программы
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 Интерфейс_п_р_3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{ }
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
}
}
Результат работы программы
Практическая работа №4
Тема: «Добавление рабочих панелей»
Листинг программы
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 Интерфейс_п_р_3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
Close();
}
private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = "Close Form";
}
}
}
Результат работы программы
Практическая работа № 5
Тема: «Работа с текстом и файлами в приложении»
Листинг программы
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 Интерфейс_п_р_3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
Close();
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
Close();
}
private void toolStripStatusLabel1_Click(object sender, EventArgs e)
{
toolStripStatusLabel1.Text = "Close Form";
}
private void button1_Click(object sender, EventArgs e)
{
saveFileDialog1.Filter = "txt files (*.txt)|*.txt";
if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK
&& saveFileDialog1.FileName.Length > 0)
{
richTextBox1.SaveFile(saveFileDialog1.FileName,
RichTextBoxStreamType.PlainText);
}
}
}
}
Результат работы программы
Практическая работа №6
Тема: «Добавление форм в проект Windows»
Листинг программы
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 Интерфейс_п_р_6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm = new Form2();
frm.Show();
}
public class Form2 : Form
{
public Form2()
{
Text = "Справка";
}
}
}
}
Результат работы программы
Практическая работа №8
Тема: «Дополнительные возможности Visual Studio 2008»
Внедрение проигрывателя Windows Media в форму
Листинг программы
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 Интерфейс_п_р_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Результат работы программы
Отображение даты в приложении
Листинг программы
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 Интерфейс_п_р_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.label1.Text = this.monthCalendar1.SelectionRange.Start.ToShortDateString();
}
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{ this.label1.Text=this.monthCalendar1.SelectionRange.Start.ToShortDateString();
}}}
Результат работы программы
Отображение времени в приложении
Листинг программы
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 Интерфейс_п_р_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
this.dateTimePicker1.Format = DateTimePickerFormat.Time;
this.dateTimePicker1.Width = 100;
this.dateTimePicker1.ShowUpDown = true;
}
private void button1_Click(object sender, EventArgs e)
{
this.dateTimePicker1.Value = DateTime.Now;
}}}
Не нашли, что искали? Воспользуйтесь поиском по сайту:
©2015 - 2024 stydopedia.ru Все материалы защищены законодательством РФ.
|