求组,我的毕业设计,下面不会做了 大家帮帮忙
下面是我的全部代码,基本模式就是这样,但内部功能我不会做,大家帮个忙using System;
using System.Drawing;
using System.Collections;
using
using System.Windows.Forms;
using System.Data;
namespace LY
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows. comboBox1;
private System.Windows. comboBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
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.ToolBarButton toolBarButton4;
private System.Windows.Forms.ToolBarButton toolBarButton5;
private System.Windows.Forms.ToolBarButton toolBarButton6;
private System.Windows.Forms.ToolBarButton toolBarButton7;
private System.Windows.Forms.ToolBarButton toolBarButton9;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.FontDialog fontDialog1;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox2;
private System.Windows. comboBox3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.ListView listView1;
private System.Data.DataView dataView1;
private components;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
= new ();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.listView1 = new System.Windows.Forms.ListView();
this.button2 = new System.Windows.Forms.Button();
= new System.Windows.();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
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.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton7 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton9 = new System.Windows.Forms.ToolBarButton();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
= new System.Windows.();
= new System.Windows.();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.fontDialog1 = new System.Windows.Forms.FontDialog();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.imageList1 = new System.Windows.Forms.ImageList();
this.dataView1 = new System.Data.DataView();
this.groupBox1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.groupBox2.SuspendLayout();
(()(this.dataView1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.tabControl1);
this.groupBox1.Location = new System.Drawing.Point(440, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(296, 472);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "检索";
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Location = new System.Drawing.Point(8, 32);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(280, 432);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.listView1);
this.tabPage1.Controls.Add(this.button2);
this.tabPage1.Controls.Add();
this.tabPage1.Controls.Add(this.textBox2);
this.tabPage1.Controls.Add(this.label6);
this.tabPage1.Controls.Add(this.label5);
this.tabPage1.Location = new System.Drawing.Point(4, 21);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(272, 407);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "条件检索";
//
// listView1
//
this.listView1.Location = new System.Drawing.Point(16, 104);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(224, 248);
this.listView1.TabIndex = 5;
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// button2
//
this.button2.Location = new System.Drawing.Point(144, 56);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 24);
this.button2.TabIndex = 4;
this.button2.Text = "检索";
//
// comboBox3
//
(new object[] {
"开心",
"郁闷",
"一般"});
= new System.Drawing.Point(48, 56);
= "comboBox3";
= new System.Drawing.Size(64, 20);
= 3;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(48, 24);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(200, 21);
this.textBox2.TabIndex = 2;
this.textBox2.Text = "";
//
// label6
//
this.label6.Location = new System.Drawing.Point(8, 56);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(32, 24);
this.label6.TabIndex = 1;
this.label6.Text = "心情";
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 16);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(40, 24);
this.label5.TabIndex = 0;
this.label5.Text = "标题";
//
// tabPage2
//
this.tabPage2.Location = new System.Drawing.Point(4, 21);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(272, 407);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "最近一周";
//
// tabPage3
//
this.tabPage3.Location = new System.Drawing.Point(4, 21);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(272, 407);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "最近一月";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.richTextBox1);
this.groupBox2.Controls.Add(this.toolBar1);
this.groupBox2.Controls.Add(this.button1);
this.groupBox2.Controls.Add(this.textBox1);
this.groupBox2.Controls.Add();
this.groupBox2.Controls.Add();
this.groupBox2.Controls.Add(this.dateTimePicker1);
this.groupBox2.Controls.Add(this.label4);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Location = new System.Drawing.Point(8, 8);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(400, 472);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "日记";
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(8, 152);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(384, 312);
this.richTextBox1.TabIndex = 10;
this.richTextBox1.Text = "";
//
// toolBar1
//
this.toolBar1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6,
this.toolBarButton7,
this.toolBarButton9});
this.toolBar1.ButtonSize = new System.Drawing.Size(41, 35);
this.toolBar1.Dock = System.Windows.Forms.DockStyle.None;
this.toolBar1.DropDownArrows = true;
this.toolBar1.Location = new System.Drawing.Point(8, 112);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(400, 41);
this.toolBar1.TabIndex = 9;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.Text = "复制";
//
// toolBarButton2
//
this.toolBarButton2.Text = "剪切";
//
// toolBarButton3
//
this.toolBarButton3.Text = "粘贴";
//
// toolBarButton4
//
this.toolBarButton4.Text = "后退";
//
// toolBarButton5
//
this.toolBarButton5.Text = "前进";
//
// toolBarButton6
//
this.toolBarButton6.Text = "字体";
//
// toolBarButton7
//
this.toolBarButton7.Text = "颜色";
//
// toolBarButton9
//
this.toolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
this.toolBarButton9.Text = "表情";
//
// button1
//
this.button1.Location = new System.Drawing.Point(312, 64);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(64, 24);
this.button1.TabIndex = 8;
this.button1.Text = "保存";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(40, 64);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(248, 21);
this.textBox1.TabIndex = 7;
this.textBox1.Text = "";
//
// comboBox2
//
(new object[] {
"开心",
"郁闷",
"一般"});
= new System.Drawing.Point(336, 24);
= "comboBox2";
= new System.Drawing.Size(48, 20);
= 6;
//
// comboBox1
//
(new object[] {
"晴",
"阴",
"雨",
"雪"});
= new System.Drawing.Point(240, 24);
= "comboBox1";
= new System.Drawing.Size(48, 20);
= 5;
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(40, 24);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(152, 21);
this.dateTimePicker1.TabIndex = 4;
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 64);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(32, 16);
this.label4.TabIndex = 3;
this.label4.Text = "标题";
//
// label3
//
this.label3.Location = new System.Drawing.Point(296, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(32, 16);
this.label3.TabIndex = 2;
this.label3.Text = "心情";
//
// label2
//
this.label2.Location = new System.Drawing.Point(200, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 16);
this.label2.TabIndex = 1;
this.label2.Text = "天气";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(40, 16);
this.label1.TabIndex = 0;
this.label1.Text = "日期";
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// dataView1
//
this.dataView1.ListChanged += new (this.dataView1_ListChanged);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(744, 486);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "Form1";
this.groupBox1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
(()(this.dataView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
//查看按下的是哪个按钮
if (e.Button == this.toolBar1.Buttons[5])
{
this.fontDialog1.ShowDialog();
this.richTextBox1.SelectionFont = this.fontDialog1.Font;
}
else if(e.Button == this.toolBar1.Buttons[6])
{
this.colorDialog1.ShowDialog();
this.richTextBox1.SelectionColor = this.colorDialog1.Color;
}
else if(e.Button == this.toolBar1.Buttons[0])
{
if (richTextBox1.SelectedText != "")
{
richTextBox1.Copy();
}
}
else if(e.Button == this.toolBar1.Buttons[1])
{
if (richTextBox1.SelectedText != "")
{
richTextBox1.Cut();
}
}
else if(e.Button == this.toolBar1.Buttons[2])
{
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) == true)
{
richTextBox1.Paste();
}
}
else if(e.Button == this.toolBar1.Buttons[3])
{
if (richTextBox1.CanUndo == true)
{
richTextBox1.Undo();
//richTextBox1.ClearUndo();
}
}
else if(e.Button == this.toolBar1.Buttons[4])
{
if (richTextBox1.CanRedo == true)
{
richTextBox1.Redo();
}
}
}
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
}
private void dataView1_ListChanged(object sender, e)
{
}
}
}