using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO; // 添加必要的命名空间
using System.Data.SqlClient; // 添加数据库支持
namespace _2
{
public partial class 主界面 : Form
{
// 声明所有控件
private SplitContainer splitContainer1;
private TreeView treeViewNotes;
private ListView listViewNotes;
private ColumnHeader columnHeader1;
private ColumnHeader columnHeader2;
private ColumnHeader columnHeader3;
private ColumnHeader columnHeader4;
private Panel panel1;
private Label lblLastModified;
private Label lblNoteTitle;
private SplitContainer splitContainer2;
private ListView listViewVersions;
private ColumnHeader columnHeader5;
private ColumnHeader columnHeader6;
private ColumnHeader columnHeader7;
private MenuStrip menuStrip1;
private ToolStripMenuItem 文件ToolStripMenuItem;
private ToolStripMenuItem 上传文件ToolStripMenuItem;
private ToolStripMenuItem 打开ToolStripMenuItem1;
private ToolStripMenuItem 退出登录ToolStripMenuItem;
private ToolStripMenuItem 注销账号ToolStripMenuItem;
private ToolStripMenuItem 编辑ToolStripMenuItem;
private ToolStripMenuItem 修改ToolStripMenuItem;
private ToolStripMenuItem 修改密码ToolStripMenuItem;
private ToolStripMenuItem 删除ToolStripMenuItem;
private ToolStripMenuItem 笔记ToolStripMenuItem;
private ToolStripMenuItem 上传文件ToolStripMenuItem1;
private ToolStripMenuItem 修改ToolStripMenuItem1;
private ToolStripMenuItem 删除ToolStripMenuItem1;
private ToolStripMenuItem 分类ToolStripMenuItem;
private ToolStripMenuItem 版本历史ToolStripMenuItem;
private ImageList imageList1;
private WebBrowser webBrowser1; // 添加缺失的WebBrowser声明
public 主界面()
{
InitializeComponent();
}
private void InitializeComponent()
{
// 初始化所有控件
this.splitContainer1 = new SplitContainer();
this.treeViewNotes = new TreeView();
this.listViewNotes = new ListView();
this.columnHeader1 = new ColumnHeader();
this.columnHeader2 = new ColumnHeader();
this.columnHeader3 = new ColumnHeader();
this.columnHeader4 = new ColumnHeader();
this.panel1 = new Panel();
this.lblLastModified = new Label();
this.lblNoteTitle = new Label();
this.splitContainer2 = new SplitContainer();
this.webBrowser1 = new WebBrowser(); // 初始化WebBrowser
this.listViewVersions = new ListView();
this.columnHeader5 = new ColumnHeader();
this.columnHeader6 = new ColumnHeader();
this.columnHeader7 = new ColumnHeader();
this.menuStrip1 = new MenuStrip();
this.文件ToolStripMenuItem = new ToolStripMenuItem();
this.上传文件ToolStripMenuItem = new ToolStripMenuItem();
this.打开ToolStripMenuItem1 = new ToolStripMenuItem();
this.退出登录ToolStripMenuItem = new ToolStripMenuItem();
this.注销账号ToolStripMenuItem = new ToolStripMenuItem();
this.编辑ToolStripMenuItem = new ToolStripMenuItem();
this.修改ToolStripMenuItem = new ToolStripMenuItem();
this.修改密码ToolStripMenuItem = new ToolStripMenuItem();
this.删除ToolStripMenuItem = new ToolStripMenuItem();
this.笔记ToolStripMenuItem = new ToolStripMenuItem();
this.上传文件ToolStripMenuItem1 = new ToolStripMenuItem();
this.修改ToolStripMenuItem1 = new ToolStripMenuItem();
this.删除ToolStripMenuItem1 = new ToolStripMenuItem();
this.分类ToolStripMenuItem = new ToolStripMenuItem();
this.版本历史ToolStripMenuItem = new ToolStripMenuItem();
this.imageList1 = new ImageList();
// 设置控件属性
this.SuspendLayout();
// splitContainer1
this.splitContainer1 = new SplitContainer();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.SuspendLayout();
this.splitContainer1.Dock = DockStyle.Fill;
this.splitContainer1.Location = new Point(0, 24);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.treeViewNotes);
this.splitContainer1.Panel1.Controls.Add(this.listViewNotes);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.panel1);
this.splitContainer1.Size = new Size(1000, 576);
this.splitContainer1.SplitterDistance = 300;
this.splitContainer1.TabIndex = 0;
// treeViewNotes
this.treeViewNotes.Dock = DockStyle.Top;
this.treeViewNotes.Location = new Point(0, 0);
this.treeViewNotes.Name = "treeViewNotes";
this.treeViewNotes.Size = new Size(300, 300);
this.treeViewNotes.TabIndex = 0;
this.treeViewNotes.ImageList = imageList1;
this.treeViewNotes.AfterSelect += new TreeViewEventHandler(this.treeViewNotes_AfterSelect);
this.treeViewNotes.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(this.treeViewNotes_NodeMouseDoubleClick);
// 初始化图像列表
this.imageList1.Images.Add(SystemIcons.Folder);
this.imageList1.Images.Add(SystemIcons.Document);
// listViewNotes
this.listViewNotes.Dock = DockStyle.Fill;
this.listViewNotes.View = View.Details;
this.listViewNotes.Columns.AddRange(new ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4
});
this.listViewNotes.Location = new Point(0, 300);
this.listViewNotes.Name = "listViewNotes";
this.listViewNotes.Size = new Size(300, 276);
this.listViewNotes.TabIndex = 1;
this.listViewNotes.UseCompatibleStateImageBehavior = false;
this.listViewNotes.FullRowSelect = true;
this.listViewNotes.MultiSelect = false;
this.listViewNotes.SelectedIndexChanged += new EventHandler(this.listViewNotes_SelectedIndexChanged);
// 设置列宽
this.columnHeader1.Text = "标题";
this.columnHeader1.Width = 120;
this.columnHeader2.Text = "分类";
this.columnHeader2.Width = 80;
this.columnHeader3.Text = "创建时间";
this.columnHeader3.Width = 120;
this.columnHeader4.Text = "最后修改";
this.columnHeader4.Width = 120;
// panel1
this.panel1.Controls.Add(this.splitContainer2);
this.panel1.Controls.Add(this.lblLastModified);
this.panel1.Controls.Add(this.lblNoteTitle);
this.panel1.Dock = DockStyle.Fill;
this.panel1.Location = new Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(696, 576);
this.panel1.TabIndex = 0;
// lblNoteTitle
this.lblNoteTitle.AutoSize = true;
this.lblNoteTitle.Font = new Font("微软雅黑", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(134)));
this.lblNoteTitle.Location = new Point(10, 10);
this.lblNoteTitle.Name = "lblNoteTitle";
this.lblNoteTitle.Size = new Size(100, 21);
this.lblNoteTitle.TabIndex = 1;
this.lblNoteTitle.Text = "未选择笔记";
// lblLastModified
this.lblLastModified.AutoSize = true;
this.lblLastModified.Location = new Point(10, 40);
this.lblLastModified.Name = "lblLastModified";
this.lblLastModified.Size = new Size(0, 12);
this.lblLastModified.TabIndex = 2;
// splitContainer2
this.splitContainer2 = new SplitContainer();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.SuspendLayout();
this.splitContainer2.Dock = DockStyle.Fill;
this.splitContainer2.Location = new Point(0, 60);
this.splitContainer2.Name = "splitContainer2";
this.splitContainer2.Orientation = Orientation.Horizontal;
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.webBrowser1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.listViewVersions);
this.splitContainer2.Size = new Size(696, 516);
this.splitContainer2.SplitterDistance = 350;
this.splitContainer2.TabIndex = 3;
// webBrowser1
this.webBrowser1.Dock = DockStyle.Fill;
this.webBrowser1.Location = new Point(0, 0);
this.webBrowser1.MinimumSize = new Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new Size(696, 350);
this.webBrowser1.TabIndex = 0;
// listViewVersions
this.listViewVersions.Dock = DockStyle.Fill;
this.listViewVersions.View = View.Details;
this.listViewVersions.Columns.AddRange(new ColumnHeader[] {
this.columnHeader5,
this.columnHeader6,
this.columnHeader7
});
this.listViewVersions.Location = new Point(0, 0);
this.listViewVersions.Name = "listViewVersions";
this.listViewVersions.Size = new Size(696, 162);
this.listViewVersions.TabIndex = 0;
this.listViewVersions.UseCompatibleStateImageBehavior = false;
this.listViewVersions.FullRowSelect = true;
this.listViewVersions.MultiSelect = false;
this.listViewVersions.DoubleClick += new EventHandler(this.listViewVersions_DoubleClick);
// 设置列宽
this.columnHeader5.Text = "版本";
this.columnHeader5.Width = 80;
this.columnHeader6.Text = "创建时间";
this.columnHeader6.Width = 120;
this.columnHeader7.Text = "描述";
this.columnHeader7.Width = 400;
// menuStrip1
this.menuStrip1.Items.AddRange(new ToolStripItem[] {
this.文件ToolStripMenuItem,
this.编辑ToolStripMenuItem,
this.笔记ToolStripMenuItem
});
this.menuStrip1.Location = new Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new Size(1000, 25);
this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1";
// 文件ToolStripMenuItem
this.文件ToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
this.上传文件ToolStripMenuItem,
this.打开ToolStripMenuItem1,
this.退出登录ToolStripMenuItem,
this.注销账号ToolStripMenuItem
});
this.文件ToolStripMenuItem.Name = "文件ToolStripMenuItem";
this.文件ToolStripMenuItem.Size = new Size(44, 21);
this.文件ToolStripMenuItem.Text = "文件";
// 上传文件ToolStripMenuItem
this.上传文件ToolStripMenuItem.Name = "上传文件ToolStripMenuItem";
this.上传文件ToolStripMenuItem.Size = new Size(152, 22);
this.上传文件ToolStripMenuItem.Text = "上传文件";
this.上传文件ToolStripMenuItem.Click += new EventHandler(this.上传文件ToolStripMenuItem_Click);
// 打开ToolStripMenuItem1
this.打开ToolStripMenuItem1.Name = "打开ToolStripMenuItem1";
this.打开ToolStripMenuItem1.Size = new Size(152, 22);
this.打开ToolStripMenuItem1.Text = "打开";
this.打开ToolStripMenuItem1.Click += new EventHandler(this.打开ToolStripMenuItem1_Click);
// 退出登录ToolStripMenuItem
this.退出登录ToolStripMenuItem.Name = "退出登录ToolStripMenuItem";
this.退出登录ToolStripMenuItem.Size = new Size(152, 22);
this.退出登录ToolStripMenuItem.Text = "退出登录";
this.退出登录ToolStripMenuItem.Click += new EventHandler(this.退出登录ToolStripMenuItem_Click);
// 注销账号ToolStripMenuItem
this.注销账号ToolStripMenuItem.Name = "注销账号ToolStripMenuItem";
this.注销账号ToolStripMenuItem.Size = new Size(152, 22);
this.注销账号ToolStripMenuItem.Text = "注销账号";
this.注销账号ToolStripMenuItem.Click += new EventHandler(this.注销账号ToolStripMenuItem_Click);
// 编辑ToolStripMenuItem
this.编辑ToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
this.修改ToolStripMenuItem,
this.修改密码ToolStripMenuItem,
this.删除ToolStripMenuItem
});
this.编辑ToolStripMenuItem.Name = "编辑ToolStripMenuItem";
this.编辑ToolStripMenuItem.Size = new Size(44, 21);
this.编辑ToolStripMenuItem.Text = "编辑";
// 修改ToolStripMenuItem
this.修改ToolStripMenuItem.Name = "修改ToolStripMenuItem";
this.修改ToolStripMenuItem.Size = new Size(152, 22);
this.修改ToolStripMenuItem.Text = "修改";
// 修改密码ToolStripMenuItem
this.修改密码ToolStripMenuItem.Name = "修改密码ToolStripMenuItem";
this.修改密码ToolStripMenuItem.Size = new Size(152, 22);
this.修改密码ToolStripMenuItem.Text = "修改密码";
this.修改密码ToolStripMenuItem.Click += new EventHandler(this.修改密码ToolStripMenuItem_Click);
// 删除ToolStripMenuItem
this.删除ToolStripMenuItem.Name = "删除ToolStripMenuItem";
this.删除ToolStripMenuItem.Size = new Size(152, 22);
this.删除ToolStripMenuItem.Text = "删除";
// 笔记ToolStripMenuItem
this.笔记ToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
this.上传文件ToolStripMenuItem1,
this.修改ToolStripMenuItem1,
this.删除ToolStripMenuItem1,
this.分类ToolStripMenuItem,
this.版本历史ToolStripMenuItem
});
this.笔记ToolStripMenuItem.Name = "笔记ToolStripMenuItem";
this.笔记ToolStripMenuItem.Size = new Size(44, 21);
this.笔记ToolStripMenuItem.Text = "笔记";
// 上传文件ToolStripMenuItem1
this.上传文件ToolStripMenuItem1.Name = "上传文件ToolStripMenuItem1";
this.上传文件ToolStripMenuItem1.Size = new Size(152, 22);
this.上传文件ToolStripMenuItem1.Text = "上传笔记";
this.上传文件ToolStripMenuItem1.Click += new EventHandler(this.上传文件ToolStripMenuItem_Click);
// 修改ToolStripMenuItem1
this.修改ToolStripMenuItem1.Name = "修改ToolStripMenuItem1";
this.修改ToolStripMenuItem1.Size = new Size(152, 22);
this.修改ToolStripMenuItem1.Text = "修改";
this.修改ToolStripMenuItem1.Click += new EventHandler(this.修改ToolStripMenuItem_Click);
// 删除ToolStripMenuItem1
this.删除ToolStripMenuItem1.Name = "删除ToolStripMenuItem1";
this.删除ToolStripMenuItem1.Size = new Size(152, 22);
this.删除ToolStripMenuItem1.Text = "删除";
this.删除ToolStripMenuItem1.Click += new EventHandler(this.删除ToolStripMenuItem1_Click);
// 分类ToolStripMenuItem
this.分类ToolStripMenuItem.Name = "分类ToolStripMenuItem";
this.分类ToolStripMenuItem.Size = new Size(152, 22);
this.分类ToolStripMenuItem.Text = "分类";
this.分类ToolStripMenuItem.Click += new EventHandler(this.分类ToolStripMenuItem_Click);
// 版本历史ToolStripMenuItem
this.版本历史ToolStripMenuItem.Name = "版本历史ToolStripMenuItem";
this.版本历史ToolStripMenuItem.Size = new Size(152, 22);
this.版本历史ToolStripMenuItem.Text = "版本历史";
this.版本历史ToolStripMenuItem.Click += new EventHandler(this.版本历史ToolStripMenuItem_Click);
// 窗体设置
this.AutoScaleDimensions = new SizeF(6F, 12F);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(1000, 600);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "主界面";
this.Text = "学习管理助手";
this.FormClosing += new FormClosingEventHandler(this.主界面_FormClosing);
this.Load += new EventHandler(this.主界面_Load);
// 恢复布局
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
// 事件处理方法(放在类中,不在InitializeComponent内)
private void 主界面_Load(object sender, EventArgs e)
{
// 初始化代码
}
private void 主界面_FormClosing(object sender, FormClosingEventArgs e)
{
// 关闭窗体处理
}
// 添加所有事件处理方法的空实现
private void treeViewNotes_AfterSelect(object sender, TreeViewEventArgs e) { }
private void treeViewNotes_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { }
private void listViewNotes_SelectedIndexChanged(object sender, EventArgs e) { }
private void listViewVersions_DoubleClick(object sender, EventArgs e) { }
private void 上传文件ToolStripMenuItem_Click(object sender, EventArgs e) { }
private void 打开ToolStripMenuItem1_Click(object sender, EventArgs e) { }
private void 退出登录ToolStripMenuItem_Click(object sender, EventArgs e) { }
private void 注销账号ToolStripMenuItem_Click(object sender, EventArgs e) { }
private void 修改密码ToolStripMenuItem_Click(object sender, EventArgs e) { }
private void 修改ToolStripMenuItem_Click(object sender, EventArgs e) { }
private void 删除ToolStripMenuItem1_Click(object sender, EventArgs e) { }
private void 分类ToolStripMenuItem_Click(object sender, EventArgs e) { }
private void 版本历史ToolStripMenuItem_Click(object sender, EventArgs e) { }
}
}
怎么改
最新发布