代码拉取完成,页面将自动刷新
同步操作将从 电脑程序爱好者/基于导航菜单的 WinForm 项目的基础框架 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
using PubSub;
using Syncfusion.Windows.Forms;
using Syncfusion.WinForms.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WinForm.NET4.Sample.CustomControl;
using WinForm.NET4.Sample.Extensions;
namespace WinForm.NET4.Sample
{
public partial class Shell : SfForm
{
string imagepath = "Images\\";
public Shell()
{
InitializeComponent();
/*You may add a rich text if need NOT a captionBar
this.Style.TitleBar.AllowRichText = true;
this.Text = "{\\rtf1\\ansi\\deff0{\\colortbl;\\red255\\green255\\blue255;\\red250\\green0\\blue0;}" + "{\\fonttbl{\\f0 Segoe UI;\r\n}}\\qc\\f0\\fs25 {\\cf1 基础框架代码 - \\cf2 \\b Win Form}}";
*/
this.CenterToScreen();
this.MinimumSize = this.Size;
//Style.Border.Width = 0;
//Style.Border.Color = Color.Black;
var captionBar = new CaptionBar();
captionBar.CaptionMouseUp += Bar_CaptionMouseUp;
this.TitleBarTextControl = captionBar;
//after assign a control to TitleBarTextControl, the client area in this form will be changed,
//need force to add a top padding.
this.Padding = new Padding(0, this.Style.TitleBar.Height + 1, 0, 0);
}
private void Bar_CaptionMouseUp(object sender, int index, EventArgs e)
{
switch (index)
{
case 1:
TabContainer.AddPage(index, new ModuleA.MainForm());
TabContainer.SelectPage(index);
break;
case 2:
TabContainer.AddPage(index, new ModuleB.MainForm());
TabContainer.SelectPage(index);
break;
case 3:
TabContainer.AddPage(index, new ModuleC.MainForm());
break;
default:
break;
}
TabContainer.SelectPage(index);
}
private void Shell_Load(object sender, EventArgs e)
{
(this.TitleBarTextControl as CaptionBar).SelectFirst();
this.toolStripStatusLabelUserInfo.Text
= $"{IdentityContext.Current.UserName}[{IdentityContext.Current.UserType}]";
Hub.Default.Subscribe<string>(this, message =>
{
//if (this.toolStripStatusLabelMsg.)
//{
// //Action<bool> actionDelegate = (x) => { this.btnSyncData.Enabled = x; };
// //this.btnSyncData.Invoke(actionDelegate, !notify.DisableRemoteOpt);
//}
//else
//{
// //this.btnSyncData.Enabled = !notify.DisableRemoteOpt;
//}
this.toolStripStatusLabelMsg.Text = message;
timerClearMessage.Enabled = true;
});
}
private void timerClearMessage_Tick(object sender, EventArgs e)
{
this.toolStripStatusLabelMsg.Text = string.Empty;
timerClearMessage.Enabled = false;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。