tangxu
2024-11-04 ebd031e3bed6c1cfddce8fc9b98f7f9e95fb9e32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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());
        }
    }
}