Создание программного продукта для расчета возможности выдачи кредита
Понятие программного продукта и его стандартизация, авторское право и стоимостная оценка. Автоматизированные банковские системы, их эволюция и технологическое построение. Сущность и структура кредита. Принципы объектно-ориентированного программирования.
Рубрика | Программирование, компьютеры и кибернетика |
Вид | дипломная работа |
Язык | русский |
Дата добавления | 19.10.2011 |
Размер файла | 879,3 K |
Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже
Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.
<File RelPath = "PaintedLetter.cs" SubType = "UserControl" BuildAction = "Compile" />
<File RelPath = "PaintedLetter.resx" DependentUpon = "PaintedLetter.cs"
BuildAction = "EmbeddedResource" />
<File RelPath = "PaintedSchedule.cs" SubType = "UserControl" BuildAction = "Compile" />
<File RelPath = "PaintedSchedule.resx" DependentUpon = "PaintedSchedule.cs"
BuildAction = "EmbeddedResource" />
<File RelPath = "RoundRect.cs" SubType = "Code" BuildAction = "Compile" />
<File RelPath = "RoundRect2.cs" SubType = "Code" BuildAction = "Compile" />
<File RelPath = "Schedule.cs" SubType = "Code" BuildAction = "Compile" />
<File RelPath = "Schedule.resx" DependentUpon = "Schedule.cs"
BuildAction = "EmbeddedResource" />
</Include> </Files> </CSHARP> </VisualStudioProject>
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Drawing.Drawing2D;
/// <summary>
/// Summary description for Form1.
/// </summary>
///
[Serializable]
public class Organizer : System.Windows.Forms.Form
{ private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.FontDialog fontDialog1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.Panel mainPanel1;
private System.Windows.Forms.Panel mainPanel2;
private System.Windows.Forms.Panel mainPanel3;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.DataGrid dataGrid1;
public static ArrayList alContacts = new ArrayList();
public static ArrayList alPaintedItems = new ArrayList();
public static ArrayList alPictures = new ArrayList();
public static string ClickedLetter;
public static int EnteredContact;
public static string CurrentPathToPicture;
public static Color OrgBackColor = Color.White;
public static Color OrgFontColor = Color.RoyalBlue;
public static int OrgFntSize = 14;
public static FontStyle OrgFntStyle = FontStyle.Italic;
public static string OrgFntName = "Monotype Corsiva";
public static System.Windows.Forms.PictureBox pictureBox1 = new PictureBox();
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Panel panel6;
private System.Windows.Forms.Button button4;
public static System.Windows.Forms.Panel panel1 = new Panel();
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Panel panel7;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button6;
private Point mouseOffset;
private bool isMouseDown = false;
private bool izMax = false;
public static bool LeftButtonPressed;
public Organizer()
{ InitializeComponent(); CenterToScreen(); DrawAll(); DrawLettersRus();
DrawLettersEng(); AddContextmenu(); DrawPaintedHours();
CurrentDateOnTheForm = dateTimePicker1.Value;
//pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
//| System.Windows.Forms.AnchorStyles.Right)));
pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) )));
pictureBox1.Location = new System.Drawing.Point(0, 0); pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new System.Drawing.Size(200, 300); pictureBox1.TabIndex = 17;
pictureBox1.TabStop = false;
pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(pictureBox1_Paint);
panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left)));
panel1.Controls.Add(pictureBox1);panel1.Location = new System.Drawing.Point(64, 32);
panel1.Name = "panel1"; panel1.Size = new System.Drawing.Size(224, 474); panel1.TabIndex = 4;
panel1.Paint += new System.Windows.Forms.PaintEventHandler(panel1_Paint);
mainPanel1.Controls.Add(panel1);
//alContacts = new ArrayList();
//alContacts.Add(new Contact(0, "ttt","ttt","ttt",DateTime.Now,"ttt","ttt","ttt","ttt","ttt"));
//alContacts.Add(new Contact(1, "www","www","www",DateTime.Now,"www","www","www","www","www"));
//alContacts.Add(new Contact(0, "ttt","ttt","ttt",DateTime.Now,"ttt","ttt","ttt","ttt","ttt"));
//alContacts.Add(new Contact(1, "www","www","www",DateTime.Now,"www","www","www","www","www"));
//UpdateGrid(); }
/// <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() {
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Organizer));
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();this.button6 = new System.Windows.Forms.Button();
this.panel7 = new System.Windows.Forms.Panel();this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.button5 = new System.Windows.Forms.Button();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.tabPage2 = new System.Windows.Forms.TabPage();this.mainPanel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();this.panel2 = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();this.panel4 = new System.Windows.Forms.Panel();
this.mainPanel2 = new System.Windows.Forms.Panel();this.mainPanel3 = new System.Windows.Forms.Panel();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.fontDialog1 = new System.Windows.Forms.FontDialog();
this.panel5 = new System.Windows.Forms.Panel();this.label1 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.panel6 = new System.Windows.Forms.Panel();this.button4 = new System.Windows.Forms.Button();
this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();this.mainPanel1.SuspendLayout();this.mainPanel2.SuspendLayout();
this.mainPanel3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.panel5.SuspendLayout();this.panel6.SuspendLayout();this.SuspendLayout();
// tabControl1
this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.tabControl1.Controls.Add(this.tabPage2);this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Location = new System.Drawing.Point(8, 24);this.tabControl1.Multiline = true;
this.tabControl1.Name = "tabControl1";this.tabControl1.Padding = new System.Drawing.Point(6, 5);
this.tabControl1.SelectedIndex = 0;this.tabControl1.Size = new System.Drawing.Size(784, 552);
this.tabControl1.TabIndex = 4;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
// tabPage1
this.tabPage1.BackColor = System.Drawing.Color.White;this.tabPage1.CausesValidation = false;
this.tabPage1.Controls.Add(this.button6); this.tabPage1.Controls.Add(this.panel7);
this.tabPage1.Controls.Add(this.toolBar1); this.tabPage1.Controls.Add(this.button5);
this.tabPage1.Controls.Add(this.dateTimePicker1); this.tabPage1.Location = new System.Drawing.Point(4, 29);
this.tabPage1.Name = "tabPage1"; this.tabPage1.Size = new System.Drawing.Size(776, 519);
this.tabPage1.TabIndex = 0; this.tabPage1.Text = "Ежедневник";
// button6
this.button6.Location = new System.Drawing.Point(240, 8); this.button6.Name = "button6";
this.button6.TabIndex = 10;this.button6.Text = "test";this.button6.Visible = false;
this.button6.Click += new System.EventHandler(this.button6_Click);
// panel7
this.panel7.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel7.AutoScroll = true;this.panel7.AutoScrollMargin = new System.Drawing.Size(100, 100);
this.panel7.AutoScrollMinSize = new System.Drawing.Size(100, 100);
this.panel7.BackColor = System.Drawing.Color.White;
this.panel7.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.panel7.Location = new System.Drawing.Point(0, 32); this.panel7.Name = "panel7";
this.panel7.Size = new System.Drawing.Size(776, 488);this.panel7.TabIndex = 9;
// toolBar1
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {this.toolBarButton1,
this.toolBarButton2, this.toolBarButton3});
this.toolBar1.Dock = System.Windows.Forms.DockStyle.None;
this.toolBar1.DropDownArrows = true;this.toolBar1.Location = new System.Drawing.Point(1500, 1500);
this.toolBar1.Name = "toolBar1";this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(344, 42);this.toolBar1.TabIndex = 6;this.toolBar1.Visible = false;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
// toolBarButton1
this.toolBarButton1.Pushed = true;
this.toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
this.toolBarButton1.Text = "Контакты";this.toolBarButton1.ToolTipText = "Справочик \"Контакты\"";
// toolBarButton2
this.toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
this.toolBarButton2.Text = "Ежедневник";
// toolBarButton3
this.toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
this.toolBarButton3.Text = "Задачи";
// button5
this.button5.BackColor = System.Drawing.Color.White;
this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.button5.ForeColor = System.Drawing.Color.RoyalBlue;
this.button5.Location = new System.Drawing.Point(0, 0);this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(120, 24);this.button5.TabIndex = 8;
this.button5.Text = "Добавить событие";this.button5.Click += new System.EventHandler(this.button5_Click);
// dateTimePicker1
this.dateTimePicker1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.dateTimePicker1.CalendarForeColor = System.Drawing.Color.RoyalBlue;
this.dateTimePicker1.CalendarTitleBackColor = System.Drawing.Color.RoyalBlue;
this.dateTimePicker1.CalendarTrailingForeColor = System.Drawing.Color.RoyalBlue;
this.dateTimePicker1.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dateTimePicker1.Location = new System.Drawing.Point(688, 8);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(88, 20);this.dateTimePicker1.TabIndex = 7;
// tabPage2
this.tabPage2.BackColor = System.Drawing.Color.White;
this.tabPage2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.tabPage2.Controls.Add(this.mainPanel1);this.tabPage2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.tabPage2.Location = new System.Drawing.Point(4, 29);this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(776, 519); this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Телефонная книга"; this.tabPage2.Click += new System.EventHandler(this.tabPage2_Click);
// mainPanel1
this.mainPanel1.AutoScroll = true;this.mainPanel1.BackColor = System.Drawing.Color.White;
this.mainPanel1.Controls.Add(this.panel3); this.mainPanel1.Controls.Add(this.panel2);
this.mainPanel1.Controls.Add(this.textBox1);this.mainPanel1.Controls.Add(this.panel4);
this.mainPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainPanel1.Location = new System.Drawing.Point(0, 0); this.mainPanel1.Name = "mainPanel1";
this.mainPanel1.Size = new System.Drawing.Size(772, 515); this.mainPanel1.TabIndex = 5;
this.mainPanel1.Click += new System.EventHandler(this.panel2_Click);
// panel3
this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left)));
this.panel3.Location = new System.Drawing.Point(0, 24);this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(64, 475);this.panel3.TabIndex = 0;
this.panel3.Click += new System.EventHandler(this.panel2_Click);
// panel2
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));this.panel2.AutoScroll = true;
this.panel2.Location = new System.Drawing.Point(304, 0);this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(464, 512);this.panel2.TabIndex = 18;
this.panel2.Click += new System.EventHandler(this.panel2_Click);
this.panel2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel2_MouseDown);
// textBox1
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.textBox1.Location = new System.Drawing.Point(168, 0); this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(136, 23);this.textBox1.TabIndex = 5;this.textBox1.Text = "";
this.textBox1.Visible = false;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged_1);
// panel4
this.panel4.BackColor = System.Drawing.Color.White;this.panel4.Location = new System.Drawing.Point(104, 0);
this.panel4.Name = "panel4";this.panel4.Size = new System.Drawing.Size(64, 24);this.panel4.TabIndex = 0;
this.panel4.Click += new System.EventHandler(this.panel2_Click);
// mainPanel2
this.mainPanel2.BackColor = System.Drawing.Color.LightYellow;
this.mainPanel2.Controls.Add(this.mainPanel3);
this.mainPanel2.Location = new System.Drawing.Point(1500, 1500);this.mainPanel2.Name = "mainPanel2";
this.mainPanel2.Size = new System.Drawing.Size(72, 32);this.mainPanel2.TabIndex = 0;
this.mainPanel2.Visible = false;
// mainPanel3
this.mainPanel3.BackColor = System.Drawing.Color.Lime;this.mainPanel3.Controls.Add(this.dataGrid1);
this.mainPanel3.Location = new System.Drawing.Point(656, 456);this.mainPanel3.Name = "mainPanel3";
this.mainPanel3.Size = new System.Drawing.Size(88, 72);this.mainPanel3.TabIndex = 0;
this.mainPanel3.Visible = false;
// dataGrid1
this.dataGrid1.DataMember = "";this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(0, 32);this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(88, 40);this.dataGrid1.TabIndex = 2;this.dataGrid1.Visible = false;
// fontDialog1
this.fontDialog1.MaxSize = 36; this.fontDialog1.ShowApply = true;this.fontDialog1.ShowColor = true;
this.fontDialog1.Apply += new System.EventHandler(this.fontDialog1_Apply);
// panel5
this.panel5.BackColor = System.Drawing.Color.RoyalBlue; this.panel5.Controls.Add(this.label1);
this.panel5.Controls.Add(this.button3);this.panel5.Controls.Add(this.button2);
this.panel5.Controls.Add(this.button1);this.panel5.Controls.Add(this.pictureBox2);
this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
this.panel5.Location = new System.Drawing.Point(0, 0);this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(800, 24);this.panel5.TabIndex = 5;
this.panel5.MouseUp += new System.Windows.Forms.MouseEventHandler(this.panel5_MouseUp);
this.panel5.Paint += new System.Windows.Forms.PaintEventHandler(this.panel5_Paint);
this.panel5.DoubleClick += new System.EventHandler(this.panel5_DoubleClick);
this.panel5.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel5_MouseMove);
this.panel5.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel5_MouseDown);
// label1
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Times New Roman", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
this.label1.ForeColor = System.Drawing.Color.Yellow;this.label1.Location = new System.Drawing.Point(32, 0);
this.label1.Name = "label1";this.label1.Size = new System.Drawing.Size(148, 25);this.label1.TabIndex = 6;
this.label1.Text = "Записная книжка";
// button3
this.button3.Dock = System.Windows.Forms.DockStyle.Right;
this.button3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.button3.Location = new System.Drawing.Point(728, 0);this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(24, 24);this.button3.TabIndex = 2;this.button3.Text = "_";
this.button3.Click += new System.EventHandler(this.button3_Click);
this.button3.SizeChanged += new System.EventHandler(this.button3_SizeChanged);
// button2
this.button2.Dock = System.Windows.Forms.DockStyle.Right;
this.button2.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.button2.Location = new System.Drawing.Point(752, 0); this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(24, 24); this.button2.TabIndex = 1;
this.button2.Click += new System.EventHandler(this.button2_Click);
// button1
this.button1.Dock = System.Windows.Forms.DockStyle.Right;
this.button1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.button1.Location = new System.Drawing.Point(776, 0);
this.button1.Name = "button1";this.button1.Size = new System.Drawing.Size(24, 24);this.button1.TabIndex = 0;
this.button1.Text = "X"; this.button1.Click += new System.EventHandler(this.button1_Click_3);
// pictureBox2
this.pictureBox2.Dock = System.Windows.Forms.DockStyle.Left;
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
this.pictureBox2.Location = new System.Drawing.Point(0, 0);
this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(24, 24);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox2.TabIndex = 5; this.pictureBox2.TabStop = false;
// panel6
this.panel6.BackColor = System.Drawing.Color.RoyalBlue; this.panel6.Controls.Add(this.button4);
this.panel6.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel6.Location = new System.Drawing.Point(0, 576); this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(800, 24);this.panel6.TabIndex = 6;
// button4
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));this.button4.BackColor = System.Drawing.Color.RoyalBlue;
this.button4.Cursor = System.Windows.Forms.Cursors.Default;
this.button4.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.button4.Location = new System.Drawing.Point(776, 0);this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(24, 23);this.button4.TabIndex = 1;
this.button4.MouseUp += new System.Windows.Forms.MouseEventHandler(this.button4_MouseUp);
this.button4.Paint += new System.Windows.Forms.PaintEventHandler(this.button4_Paint);
this.button4.MouseEnter += new System.EventHandler(this.button4_MouseEnter);
this.button4.MouseMove += new System.Windows.Forms.MouseEventHandler(this.button4_MouseMove);
this.button4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button4_MouseDown);
// Organizer
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);this.BackColor = System.Drawing.Color.RoyalBlue;
this.ClientSize = new System.Drawing.Size(800, 600);this.Controls.Add(this.panel6);
this.Controls.Add(this.panel5);this.Controls.Add(this.mainPanel2);this.Controls.Add(this.tabControl1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));this.Name = "Organizer";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Organaizer";
this.Closing += new System.ComponentModel.CancelEventHandler(this.Organizer_Closing);
this.Load += new System.EventHandler(this.Organizer_Load);this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);this.tabPage2.ResumeLayout(false);this.mainPanel1.ResumeLayout(false);
this.mainPanel2.ResumeLayout(false);this.mainPanel3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.panel5.ResumeLayout(false);this.panel6.ResumeLayout(false);this.ResumeLayout(false);}
#endregion
/// <summary> /// The main entry point for the application. /// </summary>
[STAThread] static void Main()
{Application.Run(new Organizer());}
public static ArrayList alLetters = new ArrayList(); private void DrawAll()
{ int ptX = 0, ptY=0; //int count = 0; //int portion = tabPage2.Height/24;
string letter = " Все записи" ; PaintedLetter ptall = new PaintedLetter();
PaintedLetter ptsearch = new PaintedLetter();
//Paint ptall.Name = letter.ToString(); ptall.SetLetter = letter;
ptsearch.SetLetter = " Поиск"; ptall.BackColor = Color.White;
ptsearch.BackColor = Color.White; ptall.Size = new Size(100,22);
ptsearch.Size = new Size(100,22); ptall.Location = new Point(ptX, ptY);
ptsearch.Location = new Point(panel4.ClientRectangle.X, panel4.ClientRectangle.Y);
ptall.Click+=new EventHandler(ptall_Click);ptsearch.Click+=new EventHandler(ptsearch_Click);
ptall.MouseEnter+=new EventHandler(ptall_MouseEnter);
//pt.TabIndex = count;
//pt.Focus();
//MessageBox.Show(letter.ToString()); this.paintedLetter1.BackColor = System.Drawing.Color.White;
this.paintedLetter1.Location = new System.Drawing.Point(336, 152);
this.paintedLetter1.Name = "paintedLetter1";
this.paintedLetter1.SetLetter = "K"; this.paintedLetter1.Size = new System.Drawing.Size(22, 22);
this.paintedLetter1.TabIndex = 0;this.tabPage2.Controls.Add(this.paintedLetter1);
mainPanel1.Controls.Add(ptall); panel4.Controls.Add(ptsearch);
alLetters.Add(ptall); alLetters.Add(ptsearch);
//count++; //ptY=ptY+(portion); }
private void DrawLettersRus()
{
int ptRusX = 0, ptRusY=0; int count = 0, portion = panel3.Height/58;
for(char letter = 'А' ; letter<='Я'; letter++)
{
if(letter!='Й' & letter!='Ъ' & letter!='Ь' )
{
PaintedLetter ptRus = new PaintedLetter();
//Paint
ptRus.Name = letter.ToString();
ptRus.SetLetter = letter.ToString();
ptRus.BackColor = Color.White;
ptRus.Size = new Size(22,22);
ptRus.Location = new Point(ptRusX, ptRusY);
ptRus.TabIndex = count;
ptRus.Focus();
ptRus.Click+=new EventHandler(ptRus_Click);
ptRus.MouseEnter+=new EventHandler(ptRus_MouseEnter);
//MessageBox.Show(letter.ToString());
// this.paintedLetter1.BackColor = System.Drawing.Color.White;
// this.paintedLetter1.Location = new System.Drawing.Point(336, 152);
// this.paintedLetter1.Name = "paintedLetter1";
// this.paintedLetter1.SetLetter = "K";
// this.paintedLetter1.Size = new System.Drawing.Size(22, 22);
// this.paintedLetter1.TabIndex = 0;
this.tabPage2.Controls.Add(this.paintedLetter1); panel3.Controls.Add(ptRus);alLetters.Add(ptRus);
count++;//ptRusY+=(portion);ptRusY+=16; }}}
private void DrawLettersEng() {
int ptEngX = 0, ptEngY=0; int count = 0, portion = panel3.Height/58;
for(char letter = 'A' ; letter<='Z'; letter++)
{ PaintedLetter ptEng = new PaintedLetter();
//Paint
ptEng.Name = letter.ToString();
ptEng.SetLetter = letter.ToString();
ptEng.BackColor = Organizer.OrgBackColor;
ptEng.Size = new Size(22,22);
ptEng.Location = new Point(ptEngX+20, ptEngY);
ptEng.TabIndex = count;
ptEng.Focus();
ptEng.Click+=new EventHandler(ptEng_Click);
//MessageBox.Show(letter.ToString());
// this.paintedLetter1.BackColor = System.Drawing.Color.White;
// this.paintedLetter1.Location = new System.Drawing.Point(336, 152);
// this.paintedLetter1.Name = "paintedLetter1";
// this.paintedLetter1.SetLetter = "K";
// this.paintedLetter1.Size = new System.Drawing.Size(22, 22);
// this.paintedLetter1.TabIndex = 0;
// this.tabPage2.Controls.Add(this.paintedLetter1);
panel3.Controls.Add(ptEng);
count++;alLetters.Add(ptEng); //ptEngY+=(portion);ptEngY+=16; }}
private void tabPage2_Click(object sender, System.EventArgs e){}
private void SortContacts()
{alContacts.Sort();int i = alContacts.Count; int x=0; foreach(Contact c in alContacts)
{c.ContactID = x+1; x++; }
// //alContacts.Sort
// int i = alContacts.Count;
// char ch1 = 'ю';
// char ch2 = 'я';
// char ch3 = 'Ю';
// char ch4 = 'Я';
// //MessageBox.Show((int)ch1+" "+(int)ch2+" "+(int)ch3+" "+(int)ch4);
// string s=" ";
// Contact tContact = new Contact();
// foreach (Contact c in alContacts)
// {
// s = c.ContactSecondName;
// MessageBox.Show(s[1].ToString());
// }
// for(int j = 1040; j<1072; j++)
// {
// //MessageBox.Show(((char)j).ToString());
// s+=((char)j).ToString()+" ";
// }
// //MessageBox.Show(s);
}private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e)
{if (tabControl1.SelectedTab == tabPage2) {tabControl1.SelectedTab = tabPage2;tabPage2.Focus();}
else if (tabControl1.SelectedTab == tabPage1){tabControl1.SelectedTab = tabPage1;tabPage1.Focus();}
// else //(tabControl1.SelectedTab == tabPage3)
// {
// //tabControl1.SelectedTab = tabPage3;
// //tabPage3.Focus();
// }}
public void UpdateGrid(){if(alContacts!=null){DataTable inventory = new DataTable("Inventory");
DataColumn cContactID = new DataColumn("ContactID"); cContactID.AllowDBNull = false;
cContactID.Unique = true;DataColumn cName = new DataColumn("Name");
DataColumn cSecondName = new DataColumn("SecondName");
DataColumn cSerName = new DataColumn("SerName");
DataColumn cBirthDate = new DataColumn("BirthDate");
DataColumn cHomePhone = new DataColumn("HomePhone");
DataColumn cJobPhone = new DataColumn("JobPhone");
DataColumn cCellPhone = new DataColumn("CellPhone");DataColumn cAddress = new DataColumn("Address");
DataColumn cEmail = new DataColumn("Email");DataColumn cPicture = new DataColumn("Picture");
inventory.Columns.Add(cContactID);inventory.Columns.Add(cName);
inventory.Columns.Add(cSecondName);inventory.Columns.Add(cSerName);
inventory.Columns.Add(cBirthDate);inventory.Columns.Add(cHomePhone);
inventory.Columns.Add(cJobPhone);inventory.Columns.Add(cCellPhone);inventory.Columns.Add(cAddress);
inventory.Columns.Add(cEmail); inventory.Columns.Add(cPicture);
//myDataSet = new DataSet();//myDataSet.Tables.Add(inventory);dataGrid1.DataSource = inventory;
//dataGrid1.SetDataBinding(myDataSet, "");
for(int i=0; i<=Contacts.idC;i++)
// for(int j=0; j<10; j++)
// {
// //inventory. Contacts.arContacts[i,j];
// }
foreach(Contact c in alContacts) {DataRow newRow;newRow = inventory.NewRow();
newRow["ContactID"] = c.ContactID;newRow["Name"] = c.ContactName;
newRow["SecondName"] = c.ContactSecondName; newRow["SerName"] = c.ContactSerName;
newRow["BirthDate"] = c.ContactBirthDate;newRow["HomePhone"] = c.ContactHomePhone;
newRow["JobPhone"] = c.ContactJobPhone;newRow["CellPhone"] = c.ContactCellPhone;
newRow["Address"] = c.ContactAddress;newRow["Email"] = c.ContactEmail; inventory.Rows.Add(newRow);}
dataGrid1.DataSource = inventory; //dataGrid1.Update(); }}
public void PaintItemsWhenAdd() {int old = alContacts.Count-1;SortContacts();if(alPaintedItems!=null)
{foreach(PaintedContact p in alPaintedItems){panel2.Controls.Remove(p);}} alPaintedItems.Clear();
int i = alContacts.Count; int x=20; foreach(Contact c in alContacts) {
PaintedContact pi = new PaintedContact(c.ContactID, c.ContactName, c.ContactSecondName, c.ContactSerName, c.ContactBirthDate, c.ContactHomePhone, c.ContactJobPhone, c.ContactCellPhone, c.ContactAddress, c.ContactEmail); pi.Location = new Point(60, x); //pi.Name = "Painted "+c.carID.ToString(); x+=60;
pi.BackColor = OrgBackColor; //pi.Size = new Size(300, 20);
pi.DoubleClick+=new EventHandler(pi_DoubleClick);pi.Click+=new EventHandler(pi_Click);
pi.MouseEnter+=new EventHandler(pi_MouseEnter);pi.MouseLeave+=new EventHandler(pi_MouseLeave);
alPaintedItems.Add(pi); //Controls.Add((PaintedItem)alPaintedItems[c.carID]);
panel2.Controls.Add(pi); //Invalidate();} for(int s = 0; s<alPaintedItems.Count; s++)
{//this.Controls.Add((PaintedItem)alPaintedItems[s]);} //Invalidate();}
public void PaintItems() {SortContacts(); if(alPaintedItems!=null) {foreach(PaintedContact p in alPaintedItems)
{ panel2.Controls.Remove(p); } }alPaintedItems.Clear();int i = alContacts.Count; int x=20;foreach(Contact c in alContacts) {
PaintedContact pi = new PaintedContact(c.ContactID, c.ContactName, c.ContactSecondName, c.ContactSerName, c.ContactBirthDate, c.ContactHomePhone, c.ContactJobPhone, c.ContactCellPhone, c.ContactAddress, c.ContactEmail); pi.Location = new Point(60, x); //pi.Name = "Painted "+c.carID.ToString(); x+=60;
pi.BackColor = OrgBackColor; //pi.Size = new Size(300, 20);
pi.DoubleClick+=new EventHandler(pi_DoubleClick);pi.Click+=new EventHandler(pi_Click);
pi.MouseEnter+=new EventHandler(pi_MouseEnter);pi.MouseLeave+=new EventHandler(pi_MouseLeave);
alPaintedItems.Add(pi);//Controls.Add((PaintedItem)alPaintedItems[c.carID]);
panel2.Controls.Add(pi); //Invalidate();} for(int s = 0; s<alPaintedItems.Count; s++) {
//this.Controls.Add((PaintedItem)alPaintedItems[s]); }
//Invalidate();
}public int PaintItems(string l){SortContacts();foreach(PaintedContact p in alPaintedItems)
{panel2.Controls.Remove(p);}alPaintedItems.Clear();int i = alContacts.Count;
int x=20; foreach(Contact c in alContacts) {if((c.ContactSecondName).StartsWith(l)) {
PaintedContact pi = new PaintedContact(c.ContactID, c.ContactName, c.ContactSecondName, c.ContactSerName, c.ContactBirthDate, c.ContactHomePhone, c.ContactJobPhone, c.ContactCellPhone, c.ContactAddress, c.ContactEmail); pi.Location = new Point(60, x); //pi.Name = "Painted "+c.carID.ToString(); x+=60;
//pi.Size = new Size(300, 20);
pi.BackColor = OrgBackColor; pi.DoubleClick+=new EventHandler(pi_DoubleClick);
pi.Click+=new EventHandler(pi_Click); pi.MouseEnter+=new EventHandler(pi_MouseEnter);
alPaintedItems.Add(pi); //Controls.Add((PaintedItem)alPaintedItems[c.carID]);
panel2.Controls.Add(pi);
//if(c.ContactPicture!=null)
//CurrentPathToPicture = c.ContactPicture;
//if(CurrentPathToPicture!=null)
//pictureBox1.Image = Image.FromFile(CurrentPathToPicture);
//pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
//pictureBox1.BorderStyle =BorderStyle.Fixed3D;
//pictureBox1.Invalidate();
//Invalidate();
}}for(int s = 0; s<alPaintedItems.Count; s++){//this.Controls.Add((PaintedItem)alPaintedItems[s]);}
//Invalidate();
return alPaintedItems.Count;}
public void RestoreData(){alContacts.Clear();//alPictures.Clear();Stream myStream = null;
//Stream myStream2 = null;
try{myStream = File.OpenRead("contacts.org");//myStream2 = File.OpenRead("contactsPictures.org"); }
catch(FileNotFoundException) {
//MessageBox.Show(exc.Message+"\nФайл с данными не найден,\nв каталоге программы будет создан новый файл.");
try{myStream = File.Create("contacts.org");myStream.Close();
//myStream2 = File.Create("contactsPictures.org");
//myStream2.Close();
}
catch(Exception) {}return;}BinaryFormatter myBinaryFormat = new BinaryFormatter();
//BinaryFormatter myBinaryFormat2 = new BinaryFormatter();
try{ alContacts = (ArrayList)myBinaryFormat.Deserialize(myStream); myStream.Close();
//alPictures = (ArrayList)myBinaryFormat2.Deserialize(myStream2);
}catch(System.Runtime.Serialization.SerializationException) {myStream.Close();
//myStream2.Close();
return; }
//UpdateGrid(); //PaintItems(); }
public void PutItDown() {try{
//Stream myStream = null;
FileStream myStream = File.Open("contacts.org", FileMode.Open, FileAccess.Write, FileShare.Write);
BinaryFormatter myBinaryFormat = new BinaryFormatter();
myBinaryFormat.Serialize(myStream, alContacts); myStream.Close();
//FileStream myStream2 = File.Open("contactsPictures.org", FileMode.Open, FileAccess.Write, FileShare.Write);
//BinaryFormatter myBinaryFormat2 = new BinaryFormatter();
//myBinaryFormat2.Serialize(myStream2, alPictures);
//myStream.Close();
}catch(Exception){}}
public void RePaintItems(){//MessageBox.Show("Inside RePaintItems!");int i = alContacts.Count;
foreach(PaintedContact p in alPaintedItems){//p=(PaintedItem)p;panel2.Controls.Remove(p);} }
private void Organizer_Load(object sender, System.EventArgs e){tabControl1.SelectedTab = tabPage2;
tabPage1.Focus();RestoreData();PaintItems();UpdateGrid();
//if(((Contact)(alContacts[0])).ContactPicture!=null)
//pictureBox1.Image = Image.FromFile(((Contact)(alContacts[0])).ContactPicture);
//CurrentPathToPicture = (((Contact)(alContacts[0])).ContactPicture);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox1.BorderStyle =BorderStyle.Fixed3D;
EnteredContact = 1;}private void menuItem3_Click(object sender, System.EventArgs e){}
private void pi_DoubleClick(object sender, EventArgs e){}
private void button1_Click(object sender, System.EventArgs e){Invalidate();RePaintItems();}
private void Organizer_Closing(object sender, System.ComponentModel.CancelEventArgs e){PutItDown();}
private void menuItem7_Click(object sender, System.EventArgs e){ }
private void menuItem4_Click(object sender, System.EventArgs e){}
private void menuItem12_Click(object sender, System.EventArgs e){ }
private void fontDialog1_Apply(object sender, System.EventArgs e){
PaintedContact.fntSize = fontDialog1.Font.Size; PaintItems();PaintedContact.fntStyle = fontDialog1.Font.Style;
PaintedContact.fntFamily = new FontFamily(fontDialog1.Font.Name);OrgFntSize = (int)fontDialog1.Font.Size;
OrgFntStyle = fontDialog1.Font.Style;OrgFntName = fontDialog1.Font.Name;OrgFontColor = fontDialog1.Color;
foreach (PaintedContact pc in alPaintedItems){pc.LetterColor= fontDialog1.Color;pc.Invalidate();}
foreach(PaintedLetter pl in alLetters){pl.LetterColor= fontDialog1.Color;pl.Invalidate();}
panel1.Invalidate();}
private void ptRus_Click(object sender, EventArgs e){//UpdateGrid(); int i = PaintItems(ClickedLetter); if(i!=0)
{try{int num = ((PaintedContact)(alPaintedItems[0])).itemID;
string path = ((Contact)(alContacts[num-1])).ContactPicture; pictureBox1.Image = Image.FromFile(path);
int n = ((PaintedContact)(alPaintedItems[0])).itemID;EnteredContact = n;panel1.Invalidate();}catch(Exception){} }
else if(i==0){pictureBox1.Image = null;EnteredContact =0;panel1.Invalidate(); }//pictureBox1.Image = null;
//PutItDown(); //MessageBox.Show(ClickedLetter);}private void pi_Click(object sender, EventArgs e) {
UpdateGrid(); PaintItems(); PutItDown();}private void ptall_Click(object sender, EventArgs e){
UpdateGrid(); PaintItems(); PutItDown(); //int num = ((PaintedContact)(alPaintedItems[0])).itemID;
string path = ((Contact)(alContacts[0])).ContactPicture;pictureBox1.Image = Image.FromFile(path);
EnteredContact=1;panel1.Invalidate();} private void ptRus_MouseEnter(object sender, EventArgs e)
{UpdateGrid();PaintItems(ClickedLetter); PutItDown();}
private void menuItem2_Click(object sender, System.EventArgs e){}
private void ptall_MouseEnter(object sender, EventArgs e){UpdateGrid();PaintItems(); PutItDown();}
private void button1_Click_1(object sender, System.EventArgs e){//SortContacts();}
public void SearchContactByLetters(){}
private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e){
// char ch = (char)e.KeyCode;
// string s = ( (char)(alContacts.BinarySearch(ch))).ToString();
// string s = textBox1.Text;
// int i = alContacts.BinarySearch(s);
//// int count = 0;
// MessageBox.Show(s+" "+i);
// foreach(Contact c in alContacts)
// {
// try
// {
// if(c.ContactSecondName[count] == ch)
// {
// //MessageBox.Show();
// }
// else if ()
// {
// }
// }
// catch(IndexOutOfRangeException exc)
// {
// MessageBox.Show(exc.Message);
// }
// }
}
private void textBox1_TextChanged(object sender, System.EventArgs e){
//pictureBox1.BorderStyle =BorderStyle.Fixed3D; //RePaintItems(); foreach(Contact c in alContacts)
// {
// if(c.ContactSecondName.StartsWith(textBox1.Text))
// {
// PaintItems(textBox1.Text);
// }
// }
// int i=0;
// try
// {
// string s = textBox1.Text;
// CompareContacts comp = new CompareContacts();
// i = alContacts.BinarySearch(s, comp);
// MessageBox.Show(s+" "+i);
//}
//catch(InvalidOperationException exc)
//{
//MessageBox.Show(exc.Message + " "+ i.ToString());
//}
}
private void ptEng_Click(object sender, EventArgs e)
{
//UpdateGrid();
int i = PaintItems(ClickedLetter);
if(i!=0)
{ try {int num = ((PaintedContact)(alPaintedItems[0])).itemID;
string path = ((Contact)(alContacts[num-1])).ContactPicture;
pictureBox1.Image = Image.FromFile(path);int n = ((PaintedContact)(alPaintedItems[0])).itemID;
EnteredContact = n;panel1.Invalidate();}catch(Exception){}}else if(i==0){pictureBox1.Image = null;
EnteredContact =0;panel1.Invalidate();}//try//{//PaintItems(ClickedLetter);
//string path = ((Contact)(alContacts[num-1])).ContactPicture;
//pictureBox1.Image = Image.FromFile(path);//}// catch(Exception)
//{}}
private void groupBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)}
private void pi_MouseEnter(object sender, EventArgs e)
{panel1.Invalidate();try{
string str = null;
foreach(Contact c in alContacts)
{
if(c.ContactID==EnteredContact)
{
str= c.ContactPicture;
}
}
if(str!=null)
{
pictureBox1.Image = Image.FromFile(str);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
//pictureBox1.BorderStyle =BorderStyle.Fixed3D;
}
else if (str==null)
{
pictureBox1.Image = null;
}
}
catch(Exception)
{
}
}
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
if(pictureBox1.Image==null)
{
PaintEmptyPicture(e);
pictureBox1.Invalidate();
}
}
private void PaintEmptyPicture(PaintEventArgs e)
{
string str = "Фото";
GraphicsPath gp = new GraphicsPath();
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
StringFormat format = new StringFormat(StringFormatFlags.DisplayFormatControl);
//format.Alignment = StringAlignment.Near;
format.FormatFlags = StringFormatFlags.FitBlackBox;
format.Alignment = StringAlignment.Center;
int fntSize = 42;
FontStyle fntStyle = FontStyle.Italic;
FontFamily fntFamily = new FontFamily("Arial");
Font fnt = new Font(fntFamily, fntSize, fntStyle);
Rectangle r = new Rectangle(pictureBox1.ClientRectangle.X, pictureBox1.ClientRectangle.Y,pictureBox1.Width, pictureBox1.Height);
e.Graphics.FillRectangle(Brushes.Purple, r);
e.Graphics.DrawString(str, fnt, new SolidBrush(Color.MediumPurple),pictureBox1.ClientRectangle.Width/2, pictureBox1.ClientRectangle.Height/2-fnt.Height/2, format);
}
private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
try
{
Contact c = new Contact();
c = (Contact)(alContacts[EnteredContact-1]);
string str = c.ContactSecondName+" "+c.ContactName+" "+c.ContactSerName+"\n"+c.ContactBirthDate+"\n"+c.ContactAddress+"\n"+c.ContactEmail+"\nТелефоны:\n\tдомашний:"+c.ContactHomePhone+"\n\tрабочий:"+c.ContactJobPhone+"\n\tсотовый:"+c.ContactCellPhone;
GraphicsPath gp = new GraphicsPath();
e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
StringFormat format = new StringFormat(StringFormatFlags.DisplayFormatControl);
//format.Alignment = StringAlignment.Near;
format.FormatFlags = StringFormatFlags.FitBlackBox;
int fntSize = OrgFntSize;
FontStyle fntStyle = OrgFntStyle;
FontFamily fntFamily = new FontFamily(OrgFntName);
Font fnt = new Font(fntFamily, fntSize, fntStyle);
Rectangle r = new Rectangle(panel1.ClientRectangle.X, panel1.ClientRectangle.Y+pictureBox1.Height+50,panel1.Width, panel1.Height);
//e.Graphics.FillRectangle(Brushes.LightYellow, r);
e.Graphics.DrawString(str, fnt, new SolidBrush(OrgFontColor),r, format);
}
catch(Exception)
{
}
//e.Graphics.DrawString( groupBox1.ClientRectangle.X,groupBox1.ClientRectangle.Y+350,
//string tmp = (e.Graphics.MeasureString(str, fnt)).ToString();
//float ff = (e.Graphics.MeasureString(str, fnt)).Width;
//this.Width = (int) ((str.Length)*(fnt.Size));
//this.Width = (int)ff;
//Rectangle r = new Rectangle();
//r = ClientRectangle;
//Pen pen = new System.Drawing.Pen(Color.Red);
//pen.Color = Color.Red;
//pen.Width = 2;
//r.Height-=1;
//r.Width-=1;
}
private void panel2_Click(object sender, System.EventArgs e)
{
if(LeftButtonPressed)
{
//new AddRemoveContact().Show();
AddContact d = new AddContact();
if(d.ShowDialog() == DialogResult.OK)
{
alContacts.Add(d.theContact);
//alPictures.Add(d.theContactPicture);
UpdateGrid();
PaintItemsWhenAdd();
try
{
Organizer.pictureBox1.Image = Image.FromFile(((Contact)(alContacts[0])).ContactPicture, true);
Organizer.EnteredContact = 1;
Organizer.panel1.Invalidate();
}
catch(Exception)
{ }}}}
private void textBox1_TextChanged_1(object sender, System.EventArgs e)
{
PaintItems(textBox1.Text);
int i = alPaintedItems.Count;
if(i!=0)
EnteredContact = ((PaintedContact)alPaintedItems[0]).itemID;
panel1.Invalidate();
//if(CurrentPathToPicture!=null)
int num=0;
if(i!=0)
{
num = ((PaintedContact)alPaintedItems[0]).itemID;
num--;
}
string tmp = "";
if(i!=0)
{tmp = ((Contact)(alContacts[num])).ContactPicture;
if(tmp!=null)pictureBox1.Image = Image.FromFile(tmp);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; }
else if(i==0)
{pictureBox1.Image = null;
EnteredContact = 0;
panel1.Invalidate();}
//MessageBox.Show((tmp.Length).ToString());
//pictureBox1.Image = null; }
private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
// if(this.toolBarButton1.Pushed)
// {
// toolBarButton2.Pushed = false;
// toolBarButton3.Pushed = false;
// mainPanel1.Visible = true;
// mainPanel2.Visible = false;
// mainPanel3.Visible = false;
// }
// else if(this.toolBarButton2.Pushed)
// {
// toolBarButton1.Pushed = false;
// toolBarButton3.Pushed = false;
// mainPanel1.Visible = false;
// mainPanel2.Visible = true;
// mainPanel3.Visible = false;
// }
// else if(this.toolBarButton3.Pushed)
// {
// e.Button.
// toolBarButton1.Pushed = false;
// toolBarButton2.Pushed = false;
// mainPanel1.Visible = false;
// mainPanel2.Visible = false;
// mainPanel3.Visible = true;
// }
if(e.Button.Text == "Контакты")
{
toolBarButton2.Pushed = false;
toolBarButton3.Pushed = false;
mainPanel1.Visible = true;
mainPanel2.Visible = false;
mainPanel3.Visible = false;
}
else if(e.Button.Text == "Ежедневник")
{
toolBarButton1.Pushed = false;
toolBarButton3.Pushed = false;
mainPanel1.Visible = false;
mainPanel2.Visible = true;
mainPanel3.Visible = false;
}
else if(e.Button.Text == "Задачи")
{
toolBarButton1.Pushed = false;
toolBarButton2.Pushed = false;
mainPanel1.Visible = false;
mainPanel2.Visible = false;
mainPanel3.Visible = true;
}
}
private void vScrollBar1_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
{ }
private void button1_Click_2(object sender, System.EventArgs e)
{string str = "alPictures.Count: "+alPictures.Count;
// richTextBox1.Text = str;
// pictureBox1.Image= Image.FromFile(CurrentPathToPicture);
// pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
// pictureBox1.BorderStyle =BorderStyle.Fixed3D;
RePaintItems(); }
private void pi_DeleteMethod()
{}
private void pi_MouseLeave(object sender, EventArgs e)
{
//pictureBox1.Image = null;
//EnteredContact = 0;
//panel1.Invalidate();
}
private void menuItem14_Click(object sender, System.EventArgs e)
{}
private void ptsearch_Click(object sender, EventArgs e)
{
if(textBox1.Visible == false)
{
textBox1.Visible = true;
textBox1.Focus();
}
else if(textBox1.Visible == true)
textBox1.Visible = false;
//mainPanel1.Invalidate();
//MessageBox.Show("");
}
public void AddContextmenu()
{
// Create a context menu.
ContextMenu m = new ContextMenu();
tabPage2.ContextMenu= m;
// Create MenuItem objects.
MenuItem menuItm1 = new MenuItem();
MenuItem menuItm2 = new MenuItem();
MenuItem menuItm3 = new MenuItem();
MenuItem menuItm4 = new MenuItem();
MenuItem menuItm5 = new MenuItem();
MenuItem menuItm6 = new MenuItem();
MenuItem menuItm7 = new MenuItem();
MenuItem menuItm8 = new MenuItem();
MenuItem menuItm9 = new MenuItem();
MenuItem menuItm10 = new MenuItem();
MenuItem menuItm11= new MenuItem();
MenuItem menuItm12 = new MenuItem();
MenuItem menuItm13 = new MenuItem();
// Set the Text property.
menuItm1.Text = "File";
menuItm2.Text = "Open Contacts";
menuItm3.Text = "Save Contacts";
menuItm4.Text = "Delete Contacts";
menuItm5.Text = "Exit";
menuItm6.Text = "Format";
menuItm7.Text = "Font";
menuItm8.Text = "Background";
menuItm9.Text = "Configuration";
menuItm10.Text = "Language";
menuItm11.Text = "Russian";
menuItm12.Text = "English";
menuItm13.Text = "Help";
menuItm1.MenuItems.AddRange(new MenuItem[] {menuItm2, menuItm3, menuItm4, menuItm5});
menuItm6.MenuItems.AddRange(new MenuItem[] {menuItm7, menuItm8});
menuItm9.MenuItems.AddRange(new MenuItem[] {menuItm10});
menuItm10.MenuItems.AddRange(new MenuItem[] {menuItm11, menuItm12});
// Add menu items to the MenuItems collection.
m.MenuItems.Add(menuItm1);
m.MenuItems.Add(menuItm6);
m.MenuItems.Add(menuItm9);
m.MenuItems.Add(menuItm13);
// Display the starting message.
//MessageBox.Show("Right-click the form to display the context menu items");
// Add functionality to the menu items.
menuItm1.Click += new System.EventHandler(this.menuItm1_Click);
menuItm2.Click += new System.EventHandler(this.menuItm2_Click);
menuItm3.Click+=new EventHandler(menuItm3_Click);
menuItm4.Click+=new EventHandler(menuItm4_Click);
menuItm7.Click+=new EventHandler(menuItm7_Click);
menuItm8.Click+=new EventHandler(menuItm8_Click);
}
// this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[]
// {
// this.menuItem2,
// this.menuItem3,
// this.menuItem4,
// this.menuItem5});
private void menuItm1_Click(object sender, System.EventArgs e)
{
if(!LeftButtonPressed)
{
string textReport = "You clicked the New menu item. \n" +
"It is contained in the following context menu: \n\n";
// Get information on the context menu in which menuitem1 is contained.
textReport += ContextMenu.GetContextMenu().ToString();
// Display the context menu information in a message box.
MessageBox.Show(textReport,"The ContextMenu Information");
}}private void menuItm2_Click(object sender, System.EventArgs e)
{//string textReport = "You clicked the Open menu item. \n" +
// "It is contained in the following context menu: \n\n";
//textReport += ContextMenu.GetContextMenu().ToString();
// Display the context menu information in a message box.
//MessageBox.Show(textReport,"The ContextMenu Information");
openFileDialog1.InitialDirectory = ".";
openFileDialog1.Filter = "org files (*.org)|*.org|All files(*.*)|*.*";
openFileDialog1.FilterIndex = 1;
openFileDialog1.RestoreDirectory = true;
openFileDialog1.FileName= "contacts";
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{ alContacts.Clear(); Stream myStream = null;
if((myStream = openFileDialog1.OpenFile())!=null) {BinaryFormatter myBinaryFormat = new BinaryFormatter();
alContacts = (ArrayList)myBinaryFormat.Deserialize(myStream);myStream.Close(); UpdateGrid();
PaintItems();}}}private void menuItm3_Click(object sender, EventArgs e){
saveFileDialog1.InitialDirectory = ".";saveFileDialog1.Filter = "org files (*.org)|*.org|All files(*.*)|*.*";
saveFileDialog1.FilterIndex = 1; saveFileDialog1.RestoreDirectory = true;
saveFileDialog1.FileName = "contacts"; if(saveFileDialog1.ShowDialog()==DialogResult.OK)
{ Stream myStream = null; if((myStream = saveFileDialog1.OpenFile()) != null)
{BinaryFormatter myBinaryFormat = new BinaryFormatter();myBinaryFormat.Serialize(myStream, alContacts);
myStream.Close();}}} private void menuItm4_Click(object sender, EventArgs e)
{alContacts.Clear();PutItDown(); UpdateGrid(); PaintItems();}
private void menuItem5_Click(object sender, System.EventArgs e){ }
private void menuItm7_Click(object sender, EventArgs e){ fontDialog1.ShowDialog();}
private void menuItm8_Click(object sender, EventArgs e) {ColorDialog MyDialog = new ColorDialog();
// Keeps the user from selecting a custom color.
//MyDialog.AllowFullOpen = false ;
// Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = true ;
// Sets the initial color select to the current text color.
MyDialog.Color = mainPanel1.BackColor ;
// Update the text box color if the user clicks OK
if (MyDialog.ShowDialog() == DialogResult.OK)
Подобные документы
Требования к функциям и задачам, выполняемым системой "Подбор кредита ОАО "Россельхозбанк". Проектирование архитектуры программного продукта. Структурная схема программного продукта. Описание компонент программного обеспечения. План менеджмента проекта.
курсовая работа [684,0 K], добавлен 03.05.2015Особенности алгоритмов, критерии качества. Создание и применение программного продукта на языке Delphi. Тип операционной системы. Внутренняя структура программного продукта. Руководство пользователя и программиста, расчет себестоимости и цены программы.
дипломная работа [1,5 M], добавлен 12.06.2009Сущность и история развития объектно-ориентированного программирования. Наследование как важнейшее свойство объекта. Экземпляры объектных типов. Поля объектов, методы, полиморфизм. Производительность объектных программ. Пример программного продукта.
курсовая работа [33,3 K], добавлен 25.03.2012Исследование принципов объектно-ориентированного программирования на базе языка программирования С++. Разработка программного комплекса для ведения учёта памятников города. Описание процессов сортировки, поиска, формирования статистики по памятникам.
курсовая работа [782,4 K], добавлен 26.05.2014Обоснование выбора языка программирования. Анализ входных и выходных документов. Логическая структура базы данных. Разработка алгоритма работы программы. Написание программного кода. Тестирование программного продукта. Стоимость программного продукта.
дипломная работа [1008,9 K], добавлен 13.10.2013Характеристика программного продукта и стадий разработки. Расчет затрат на разработку и договорной цены, эксплуатационных расходов, связанных с использованием нового программного продукта. Оценка конкурентоспособности. Изучение, оценка рыночного спроса.
курсовая работа [139,0 K], добавлен 22.09.2008Среда программирования Delphi: общая характеристика и оценка функциональных особенностей, внутренняя структура возможности и сферы практического использования. Принципы программирования на данном языке, обзор используемых компонентов, оценка результатов.
курсовая работа [33,7 K], добавлен 12.01.2015Создание программного продукта, представляющего моделирование на компьютере логнормального распределения, определение вероятностной оценки стоимости актива. Описание работы программного продукта. Работа с графиками, таблицами, математическими функциями.
курсовая работа [742,7 K], добавлен 08.01.2009Общая характеристика, цели и функции создания, модульная структура и взаимосвязь элементов необходимого программного продукта, предъявляемые к нему требования. Комплект поставки и порядок инсталляции, запуск разработанного программного продукта.
курсовая работа [32,0 K], добавлен 11.11.2013Описание разработки программного продукта с использованием объектно-ориентированного языка программирования Delphi. Принципы рейтинговой оценки знаний Костанайского социально–технического университета. Описание внешнего вида программы, обработка событий.
дипломная работа [2,4 M], добавлен 03.07.2015