using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Runtime.InteropServices;
|
using System.Text;
|
using System.Windows.Forms;
|
using DPumpHydr.WinFrmUI.WenSkin.Controls;
|
|
namespace DPumpHydr.DesktopMain
|
{
|
public partial class MainWindowForm
|
{
|
|
protected void OnClickLeftMenu蜗壳设计( )
|
{
|
var tabPage = new WenTabPage("蜗壳设计") { BackColor = Color.Transparent, Image = null };
|
tabControl.TabPages.Add(tabPage);
|
tabControl.SelectedTab = tabPage;
|
this.Text = $"{DefaultText} - "+ "蜗壳设计";
|
|
//foreach (WenTabPage p in tabControl.TabPages)
|
//{
|
// if (p.Text == e.Text)
|
// {
|
// if (p.Controls.Count > 0 && e.Control == null)
|
// {
|
// e.Control = p.Controls[0];
|
// }
|
// tabControl.SelectedTab = p;
|
// e.TabPage = p;
|
// e.Show = true;
|
// e.Refresh = false;
|
// e.NewAdd = false;
|
// }
|
//}
|
//if (e.TabPage == null)
|
//{
|
// e.TabPage = new WenTabPage(e.Text) { BackColor = Color.Transparent, Image = e.Image ?? e.Item.Image };
|
//}
|
|
//TabControlAdd(e);
|
|
//if (e.State)
|
//{
|
// if (e.NewAdd && !tabControl.TabPages.Contains(e.TabPage))
|
// {
|
// tabControl.TabPages.Add(e.TabPage);
|
// tabControl.SelectedTab = e.TabPage;
|
// this.Text = $"{DefaultText} - {e.TabPage.Text}";
|
// }
|
// if (e.Control != null && e.Refresh)
|
// {
|
// e.TabPage.Controls.Clear();
|
// e.Control.Dock = DockStyle.Fill;
|
// e.TabPage.Controls.Add(e.Control);
|
|
// Point mouseOff = new Point(0, 0); //鼠标移动位置变量
|
// bool leftFlag = false; //标签是否为左键
|
|
// e.Control.MouseDown += (s, e) =>
|
// {
|
// if (e.Button == MouseButtons.Left)
|
// {
|
// var point = this.PointToClient(MousePosition);
|
// mouseOff = new Point(-point.X, -point.Y);
|
// leftFlag = true;
|
// //点击左键按下时标注为true;
|
// }
|
// };
|
// e.Control.MouseMove += (s, e) =>
|
// {
|
// if (leftFlag)
|
// {
|
// Point mouseSet = MousePosition;
|
// mouseSet.Offset(mouseOff.X, mouseOff.Y);
|
// //设置移动后的位置
|
// Location = mouseSet;
|
// }
|
// };
|
// e.Control.MouseUp += (s, e) =>
|
// {
|
// if (leftFlag)
|
// {
|
// leftFlag = false;
|
// //释放鼠标后标注为false;
|
// }
|
// };
|
// }
|
//}
|
}
|
|
//protected override void TabControlAdd( TabControlAddEventArgs e)
|
//{
|
// switch (e.Text)
|
// {
|
// case "DataClass":
|
// //e.Control = new UserControlDataClass();
|
// //e.NewAdd = true;
|
// break;
|
// case "常用":
|
// // e.Control = new UserControlH();
|
// // e.NewAdd = true;
|
// break;
|
// case "分页":
|
// // e.Control = new UserControlPaging();
|
// // e.NewAdd = true;
|
// break;
|
// case "测试":
|
// // e.Control = new UserControlPie();
|
// // e.NewAdd = true;
|
// break;
|
// case "模板控件":
|
// // e.TabPageText = "222222";
|
// // e.Image = e.Item.Image;
|
// // e.Control = new UserControlTemplate();
|
// break;
|
// case "树结构":
|
// // e.Control = new TreeViewControl();
|
// break;
|
// default:
|
// break;
|
// }
|
|
//}
|
|
private void Form1_ConfigButtonClick(object sender, EventArgs e)
|
{
|
new DPumpHydr.WinFrmUI.WenSkin.WenConfig().ShowDialog();
|
}
|
|
private void Form1_SkinButtonClick(object sender, EventArgs e)
|
{
|
this.MsgBoxInformation("修改皮肤按钮被点击");
|
|
DPumpHydr.WinFrmUI.WenSkin.MsgBoxShow.MsgBoxAsterisk("提醒弹出窗口");
|
DPumpHydr.WinFrmUI.WenSkin.MsgBoxShow.MsgBoxError("错误弹出窗口");
|
DPumpHydr.WinFrmUI.WenSkin.MsgBoxShow.MsgBoxInformation("消息提醒弹出窗口");
|
DPumpHydr.WinFrmUI.WenSkin.MsgBoxShow.MsgBoxWarning("警告弹出窗口");
|
}
|
|
private void WenButton1_Click(object sender, EventArgs e)
|
{
|
// this.TabPageAdd(new UserControlDataClass());
|
}
|
}
|
}
|