嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
NoteBook,双界面panel,文件搜索,文本创建、删除、追加
using System;
using System.IO;
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;
namespace NoteBook
{
public partial class NoteBook : Form
{
public windows1 w1;
public windows2 w2;
// public string box;
public NoteBook()
{
w1 = new windows1();
w2 = new windows2();
// w1.Parent = this;
// w2.Parent = this;
InitializeComponent();
output("已启动程序");
string pp = Application.StartupPath "\\log";
Class1.box = pp;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void menuStrip2_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
this.panel1.Controls.Clear(); // 清空原有的控件
// w1.TopLevel = false; // 非顶级窗口
// w1.FormBorderStyle = FormBorderStyle.None; // 不显示标题栏
w2.Dock = System.Windows.Forms.DockStyle.Fill; // 填充panel
this.panel1.Controls.Add(w2); // 添加w1窗体
w2.Show();
output("默认启动输出窗口");
}
private void button1_Click(object sender, EventArgs e)
{
w2 = new windows2();
// ((windows2)this.ParentForm).startlist();//初始化列表
this.panel1.Controls.Clear(); // 清空原有的控件
// w1.TopLevel = false; // 非顶级窗口
// w1.FormBorderStyle = FormBorderStyle.None; // 不显示标题栏
w2.Dock = System.Windows.Forms.DockStyle.Fill; // 填充panel
this.panel1.Controls.Add(w2); // 添加w1窗体
w2.Show();
output("已启动输出窗口");
}
private void button2_Click(object sender, EventArgs e)
{
this.panel1.Controls.Clear(); // 清空原有的控件
// w1.TopLevel = false; // 非顶级窗口
// w1.FormBorderStyle = FormBorderStyle.None; // 不显示标题栏
w1.Dock = System.Windows.Forms.DockStyle.Fill; // 填充panel
this.panel1.Controls.Add(w1); // 添加w1窗体
w1.Show();
w2.Dispose();
output("已启动输入窗口");
}
public void output(string log)
{
if (textBox1.Text.Length < 500)
{
textBox1.AppendText(DateTime.Now.ToString("HH:mm:ss") " " log "\r\n");
}
else
{
textBox1.Clear();
}
}
}
}