若依flowform
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
Python内容推荐
c#t自定义Button
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; using System.Drawing.Drawing2D; namespace KRT.Component.Common { /// /// 停靠面板控件 /// public class DockPanel : Panel { /// /// 关闭按钮 /// DockPanelCloseButton closeButton = new DockPanelCloseButton(); /// /// 浮动窗口 /// Form flowForm = new Form(); /// /// 分割栏 /// Splitter splitter = new Splitter(); /// /// 标题栏 /// Label titleBar = new Label(); /// /// 标题栏背景色 /// public Color TitleBackColor //using System.Drawing; { get { return titleBar.BackColor; } set { titleBar.BackColor = value; closeButton.BackColor = value; } } /// /// 标题栏前景色 /// public Color TitleForeColor { get { return titleBar.ForeColor; } set { titleBar.ForeColor = value; } } /// /// 标题栏文本 /// [Localizable(true)] public string TitleText { get { return titleBar.Text; } set { titleBar.Text = value; } } /// /// 标题栏可见 /// public bool TitleVisible { get { return titleBar.Visible; } set { titleBar.Visible = value; closeButton.Visible = value; } } /// /// 浮动窗口最大尺寸 /// Size flowFormMaxSize = new Size(640, 480); public Size FlowFormMaxSize { get { return flowFormMaxSize; } set { flowFormMaxSize = value; if (this.VisibleAll) { flowForm.Size = flowFormMaxSize; } } } /// /// 整个控件的隐藏、显示,包括浮动窗口状态下 /// bool visibleAll = true; public bool VisibleAll { get { return visibleAll; } set { visibleAll = value; if (flowForm.Controls.Count > 0) { flowForm.Visible = visibleAll; } else { this.Visible = visibleAll; } } } /// /// 控件初始化 /// public DockPanel() { //InitializeComponent(); flowForm.ShowInTaskbar = false; // 关闭按钮 closeButton.Location = new System.Drawing.Point(0, 0); closeButton.Name = "Close"; closeButton.Size = new System.Drawing.Size(16, 16); closeButton.TabIndex = 0; closeButton.BackColor = SystemColors.ControlDark; closeButton.Click += new EventHandler(closeButton_Click); // 浮动窗口 flowForm.FormBorderStyle = FormBorderStyle.SizableToolWindow; //VS2008自带的窗体设计器进行设置窗体的边框。 flowForm.ShowInTaskbar = false; //任务栏 flowForm.MaximizeBox = false; //最大化按钮 flowForm.Move += new EventHandler(flowForm_Move); //EventHandler是asp.net内置的委托,事件是特殊的委托。 flowForm.MouseCaptureChanged += new EventHandler(flowForm_MouseCaptureChanged); // flowForm.FormClosing += new FormClosingEventHandler(flowForm_FormClosing); // 标题栏 titleBar.AutoSize = false; //自动调整大小 titleBar.Dock = DockStyle.Top;//控件顶端;DockStyle是个枚举,有none, top, bottom... titleBar.Height = 18; titleBar.Padding = new Padding(3); titleBar.MouseDown += new MouseEventHandler(titleBar_MouseDown); titleBar.MouseMove += new MouseEventHandler(titleBar_MouseMove); titleBar.MouseUp += new MouseEventHandler(titleBar_MouseUp); //this.Padding = new Padding(1); this.Controls.Add(closeButton); this.Controls.Add(titleBar); this.ParentChanged += new EventHandler(DockPanel_ParentChanged); this.VisibleChanged += new EventHandler(DockPanel_VisibleChanged); this.MouseDown += new MouseEventHandler(titleBar_MouseDown); this.MouseMove += new MouseEventHandler(titleBar_MouseMove); this.MouseUp += new MouseEventHandler(titleBar_MouseUp); this.ControlAdded += new ControlEventHandler(DockPanel_ControlAdded); } /// /// 如果是用户单击浮动窗口的关闭按钮,隐藏浮动窗口 /// /// /// void flowForm_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { e.Cancel = true; flowForm.Visible = false; visibleAll = false; closeButton_Click(sender, e); } } /// /// 添加子控件时调整顺序 /// /// /// void DockPanel_ControlAdded(object sender, ControlEventArgs e) { if (e.Control != titleBar && e.Control != closeButton) { e.Control.BringToFront(); } } /// /// 同时修改Splitter的可视效果 /// /// /// void DockPanel_VisibleChanged(object sender, EventArgs e) { splitter.Visible = Visible; if (this.Parent != null && Visible) { if (!this.DesignMode) { if (this.Parent.Controls.IndexOf(splitter) < 0) { //splitter.Dock = this.Dock; //this.Parent.Controls.AddRange(new Control[] { splitter, this }); this.Parent.Controls.Add(splitter); int index = this.Parent.Controls.IndexOf(this); this.Parent.Controls.SetChildIndex(splitter, index); //this.Parent.Controls.SetChildIndex(this, index + 1); //foreach (Control item in this.Parent.Controls) //{ // Debug.WriteLine( // this.Parent.Controls.GetChildIndex(item).ToString() + " : " + // item.ToString()); //} } } } } /// /// 初始化Splitter /// /// /// void DockPanel_ParentChanged(object sender, EventArgs e) { //if (this.Parent != null) //{ // if (!this.DesignMode) // { // //Parent.Controls.Add(splitter); // splitter.Dock = this.Dock; // this.Parent.Controls.AddRange(new Control[] { splitter, this }); // } //} } /// /// 关闭事件 /// public event EventHandler CloseButtonClick; /// /// 单击关闭按钮,触发关闭事件 /// /// /// void closeButton_Click(object sender, EventArgs e) { VisibleAll = false; if (null != CloseButtonClick) { CloseButtonClick(sender, e); } } /// /// 浮动窗口开始拖动时触发 /// /// /// void flowForm_MouseCaptureChanged(object sender, EventArgs e) { if (!flowFormCapture) { flowFormCapture = true; } else { flowFormCapture = false; flowFormDock = true; } } bool flowFormDock = false; // 浮动窗口可以被停靠 bool flowFormCapture = false; // 浮动窗口开始拖动 /// /// 浮动窗口移动过程 /// /// /// void flowForm_Move(object sender, EventArgs e) { if (flowFormDock) { flowFormDock = false; switch (this.Dock) { case DockStyle.Left: if (flowForm.Location.X < Parent.Location.X) { ShowDockPanel(); } break; case DockStyle.Top: if (flowForm.Location.Y Parent.Location.X + Parent.Width) { ShowDockPanel(); } break; case DockStyle.Bottom: if (flowForm.Location.Y + flowForm.Height > Parent.Location.Y + Parent.Height) { ShowDockPanel(); } break; } } } /// /// 控件尺寸改变 /// /// protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); closeButton.Location = new Point( ClientRectangle.Right - closeButton.Width - 1, 1); closeButton.Refresh(); } Point oldMouseLocation; // 鼠标位置 Rectangle rect; // 面板区域 bool mouseDown = false; // 鼠标按下 /// /// 鼠标按下事件 /// /// /// void titleBar_MouseDown(object sender, MouseEventArgs e) { if (this.Dock != DockStyle.None && this.Dock != DockStyle.Fill) { oldMouseLocation = e.Location; mouseDown = true; rect = this.RectangleToScreen(ClientRectangle); ControlPaint.DrawReversibleFrame(rect, Color.Black, FrameStyle.Thick); } } /// /// 鼠标移动事件 /// /// /// void titleBar_MouseMove(object sender, MouseEventArgs e) { if (mouseDown) { ControlPaint.DrawReversibleFrame(rect, Color.Black, FrameStyle.Thick); rect.Offset(e.X - oldMouseLocation.X, e.Y - oldMouseLocation.Y); oldMouseLocation = e.Location; ControlPaint.DrawReversibleFrame(rect, Color.Black, FrameStyle.Thick); } } /// /// 鼠标弹起事件 /// /// /// void titleBar_MouseUp(object sender, MouseEventArgs e) { if (mouseDown) { mouseDown = false; ControlPaint.DrawReversibleFrame(rect, Color.Black, FrameStyle.Thick); Rectangle rc = this.RectangleToScreen(ClientRectangle); Point pt = this.PointToScreen(e.Location); if (!rc.Contains(pt)) { ShowFlowForm(); } } } //protected override void OnPaint(PaintEventArgs e) //{ // base.OnPaint(e); // Pen borderPen = new Pen(borderColor); // Rectangle rc = new Rectangle( // e.ClipRectangle.Left, e.ClipRectangle.Top, // e.ClipRectangle.Right - 1, e.ClipRectangle.Bottom - 1); // e.Graphics.DrawRectangle(borderPen, rc); //} /// /// 显示浮动窗口 /// void ShowFlowForm() { flowForm.Show(Parent); flowForm.Location = new Point(rect.Left, rect.Top); Size newSize = new Size(rect.Width, rect.Height); if (newSize.Width > FlowFormMaxSize.Width) { newSize.Width = FlowFormMaxSize.Width; } newSize.Height = newSize.Height + (this.TitleVisible ? SystemInformation.CaptionHeight - this.titleBar.Height : SystemInformation.CaptionHeight); if (newSize.Height > FlowFormMaxSize.Height) { newSize.Height = FlowFormMaxSize.Height; } flowForm.Size = newSize; flowForm.Text = TitleText; while (this.Controls.Count > 2) { for (int i = 0; i < this.Controls.Count; i++) { if (this.Controls[i] != closeButton && this.Controls[i] != titleBar) { flowForm.Controls.Add(this.Controls[i]); break; } } } this.Visible = false; } /// /// 显示停靠面板 /// void ShowDockPanel() { this.Visible = true; while (flowForm.Controls.Count > 0) { this.Controls.Add(flowForm.Controls[0]); } flowForm.Hide(); } } }
Vision-Language-Runtime-Cross-Version-Output-Diff-Reconciler-v1.0-原创源码与文档.zip
本批资源均为独立编写的可运行 JavaScript 工程工具,包含完整源码、README、MIT License、原创与授权声明、可复现示例、自动化测试、离线 JSON/HTML/SVG 报告和真实运行截图。适合前端开发、AI 工程、自动化测试及技术研究人员用于本地预检、证据整理和二次开发。运行环境为 Node.js 18+,压缩包不含账号、密钥、Cookie、模型权重、品牌素材或第三方受限内容。
Browser-Task-Automation-Evidence-Retention-Window-Planner-v1.0-原创源码与文档.zip
本批资源均为独立编写的可运行 JavaScript 工程工具,包含完整源码、README、MIT License、原创与授权声明、可复现示例、自动化测试、离线 JSON/HTML/SVG 报告和真实运行截图。适合前端开发、AI 工程、自动化测试及技术研究人员用于本地预检、证据整理和二次开发。运行环境为 Node.js 18+,压缩包不含账号、密钥、Cookie、模型权重、品牌素材或第三方受限内容。
洛阳某宿舍楼电气图.dwg.rar
洛阳某宿舍楼电气图.dwg.rar
集成运算放大器1.ppt.rar
集成运算放大器1.ppt.rar
某礼堂全套电气图纸_下载打开后高清.pdf.rar
某礼堂全套电气图纸_下载打开后高清.pdf.rar
政府科技项目评估效率低、标准不统一如何提高?.docx
科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。
某电站机电设计图.dwg.rar
某电站机电设计图.dwg.rar
Email-Task-Assistant-State-Transition-Invariant-Checker-v1.0-原创源码与文档.zip
本批资源均为独立编写的可运行 JavaScript 工程工具,包含完整源码、README、MIT License、原创与授权声明、可复现示例、自动化测试、离线 JSON/HTML/SVG 报告和真实运行截图。适合前端开发、AI 工程、自动化测试及技术研究人员用于本地预检、证据整理和二次开发。运行环境为 Node.js 18+,压缩包不含账号、密钥、Cookie、模型权重、品牌素材或第三方受限内容。
某电站初设电气二次图.dwg.rar
某电站初设电气二次图.dwg.rar
矿石码头改扩建工程图纸.dwg.rar
矿石码头改扩建工程图纸.dwg.rar
机器人点灯1.0+机器人点灯2.0
机器人点灯1.0+机器人点灯2.0
技术转移机构如何科学评估项目的转化价值与市场潜力?.docx
科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。
高校如何利用数字化工具提升科研项目评价质量?.docx
科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。
App-Store-Screenshot-Design-Cross-Version-Output-Diff-Reconciler-v1.0-原创源码与文档.zip
本批资源均为独立编写的可运行 JavaScript 工程工具,包含完整源码、README、MIT License、原创与授权声明、可复现示例、自动化测试、离线 JSON/HTML/SVG 报告和真实运行截图。适合前端开发、AI 工程、自动化测试及技术研究人员用于本地预检、证据整理和二次开发。运行环境为 Node.js 18+,压缩包不含账号、密钥、Cookie、模型权重、品牌素材或第三方受限内容。
技术转移机构如何提升项目转化效率与决策精准度?.docx
技术转移机构如何提升项目转化效率与决策精准度?
科技园区如何精准招引高潜力科创项目?.docx
科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。
完美复现基于多智能体系统一致性算法的电力系统分布式经济调度策略(Matlab代码实现)
【完美复现】基于多智能体系统一致性算法的电力系统分布式经济调度策略(Matlab代码实现)内容概要:本文围绕基于多智能体系统一致性算法的电力系统分布式经济调度策略展开研究,提出了一种适用于高比例新能源接入场景的协调优化方法。通过构建多时序尺度的有功无功协调优化模型,打破传统独立调控模式的局限,实现对光伏出力波动的有效响应,提升配电网运行稳定性与电能质量。该策略利用多智能体系统的一致性算法,实现分布式电源、储能及负荷等多元柔性资源的协同控制,有效缓解电压越限与潮流过载问题,显著提高新能源消纳能力,并降低系统综合损耗。文中结合IEEE33节点系统进行仿真验证,展示了在不同响应率场景下的优化效果,证明了所提方法在提升电网动态稳定性与运行可靠性方面的有效性。; 适合人群:具备电力系统、自动化或相关专业背景,熟悉MATLAB/Simulink仿真工具,从事新能源调度、智能电网优化等领域的研究人员及工程技术人员。; 使用场景及目标:①应用于高比例光伏发电接入的主动配电网经济调度中,解决电压波动与弃光问题;②为多智能体系统在电力系统分布式控制中的实际部署提供理论支持与仿真验证方案;③支持科研人员复现高水平论文成果,特别是博士论文与EI期刊论文中的关键技术。; 阅读建议:此资源侧重于理论模型构建与仿真验证,建议读者结合提供的Matlab代码进行实践操作,重点关注多智能体一致性算法的实现逻辑与参数设置,同时对照参考文献深入理解优化策略的设计思路,以达到最佳学习与应用效果。
16B.rar
当 CAD 缺失对应字体时,图纸文字会显示异常,出现乱码、问号。将下载好的字体文件复制到 AutoCAD 的 Fonts 文件夹中,即可恢复正常显示。
高校如何提升科研项目质量与申报成功率?.docx
科易网基于40亿+科创知识图谱数据库,深度探索AI技术在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,研究科技创新领域的AI+数智化解决方案,推动科技创新与产业创新智能化发展。
最新推荐




