📄 mainform.cs
字号:
this._newMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem45,
this.menuItem46,
this.menuItem47,
this.menuItem48,
this.menuItem49});
//
// menuItem45
//
this.menuItem45.Index = 0;
this.menuItem45.Text = "供货商资料(&B)";
this.menuItem45.Click += new System.EventHandler(this.menuItem45_Click);
//
// menuItem46
//
this.menuItem46.Index = 1;
this.menuItem46.Text = "订货商资料(&S)";
this.menuItem46.Click += new System.EventHandler(this.menuItem46_Click);
//
// menuItem47
//
this.menuItem47.Index = 2;
this.menuItem47.Text = "-";
//
// menuItem48
//
this.menuItem48.Index = 3;
this.menuItem48.Text = "采购单(&K)";
this.menuItem48.Click += new System.EventHandler(this.menuItem48_Click);
//
// menuItem49
//
this.menuItem49.Index = 4;
this.menuItem49.Text = "销售单(&T)";
this.menuItem49.Click += new System.EventHandler(this.menuItem49_Click);
//
// _spaces2
//
this._spaces2.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// _search
//
this._search.DropDownMenu = this._searchMenu;
this._search.ImageIndex = 4;
this._search.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
this._search.Text = "统计查询";
this._search.ToolTipText = "统计查询";
//
// _searchMenu
//
this._searchMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem54,
this.menuItem50});
//
// menuItem54
//
this.menuItem54.Index = 0;
this.menuItem54.Text = "采购查询(&S)";
this.menuItem54.Click += new System.EventHandler(this.menuItem54_Click);
//
// menuItem50
//
this.menuItem50.Index = 1;
this.menuItem50.Text = "销售查询(&T)";
this.menuItem50.Click += new System.EventHandler(this.menuItem50_Click);
//
// _spaces3
//
this._spaces3.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
//
// _systemSet
//
this._systemSet.DropDownMenu = this._systemSetMenu;
this._systemSet.ImageIndex = 5;
this._systemSet.Style = System.Windows.Forms.ToolBarButtonStyle.DropDownButton;
this._systemSet.Text = "设 置";
this._systemSet.ToolTipText = "设 置";
//
// _systemSetMenu
//
this._systemSetMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem52,
this.menuItem55,
this.menuItem51,
this.menuItem56,
this.menuItem53});
//
// menuItem52
//
this.menuItem52.Index = 0;
this.menuItem52.Text = "字典设置(&D)";
this.menuItem52.Click += new System.EventHandler(this.menuItem52_Click);
//
// menuItem55
//
this.menuItem55.Index = 1;
this.menuItem55.Text = "-";
//
// menuItem51
//
this.menuItem51.Index = 2;
this.menuItem51.Text = "产品目录(&P)";
this.menuItem51.Click += new System.EventHandler(this.menuItem51_Click);
//
// menuItem56
//
this.menuItem56.Index = 3;
this.menuItem56.Text = "-";
//
// menuItem53
//
this.menuItem53.Index = 4;
this.menuItem53.Text = "系统备份(&B)";
this.menuItem53.Click += new System.EventHandler(this.menuItem53_Click);
//
// _exitSystem
//
this._exitSystem.ImageIndex = 6;
this._exitSystem.Text = "退 出";
this._exitSystem.ToolTipText = "退 出";
//
// imageList
//
this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.imageList.ImageSize = new System.Drawing.Size(50, 39);
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
this.imageList.TransparentColor = System.Drawing.Color.Transparent;
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(656, 329);
this.Controls.Add(this.toolBar);
this.Controls.Add(this.statusBar);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.IsMdiContainer = true;
this.Menu = this.mainMenu;
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "制造业企业信息管理系统 V1.00";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing);
this.Load += new System.EventHandler(this.MainForm_Load);
((System.ComponentModel.ISupportInitialize)(this.sbDefault)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.loginInfo)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 退出系统
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
if(MessageBox.Show("确定退出吗?","退出确认",MessageBoxButtons.OKCancel,MessageBoxIcon.Question) == DialogResult.Cancel){
e.Cancel = true;
}else{
Application.Exit();
}
}
/// <summary>
/// 弹出关于系统窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void toAboutForm_Click(object sender, System.EventArgs e) {
AboutForm af = new AboutForm();
af.ShowDialog();
}
/// <summary>
/// 退出系统
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void toExitApp_Click(object sender, System.EventArgs e) {
this.login.ExitApp();
}
/// <summary>
/// 选择帐套
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void selectDA_Click(object sender, System.EventArgs e) {
DAList da = new DAList();
da.SetText = "选择帐套";
da.MdiParent = this;
da.Show();
}
/// <summary>
/// 采购定单录入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItem28_Click(object sender, System.EventArgs e) {
Eboer.MIS.MF.WinForm.Stock.StockList scl = null;
Eboer.MIS.MF.WinForm.Stock.EditOrder addSO = new Eboer.MIS.MF.WinForm.Stock.EditOrder(scl);
addSO.sign.Enabled = true;
Eboer.MIS.MF.WinForm.Stock.StockList sl = new StockList();
addSO._sl = sl;
addSO.LoadItemCol();
addSO.sign.Text = Public.GetNewInfoID("StockOrder","soSign");
addSO.SetPackSign();
addSO.Show();
}
/// <summary>
/// 销售货录入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItem34_Click(object sender, System.EventArgs e) {
Eboer.MIS.MF.WinForm.Sell.OrderList orl = null;
Eboer.MIS.MF.WinForm.Sell.EditOrder addSO = new Eboer.MIS.MF.WinForm.Sell.EditOrder(orl);
addSO.LoadItemCol();
Eboer.MIS.MF.WinForm.Sell.OrderList sl = new OrderList();
addSO._ol = sl;
addSO.sign.Enabled = true;
addSO.sign.Text = Public.GetNewInfoID("SellOrder","soSign");
addSO.SetPackSign();
addSO.Show();
}
/// <summary>
/// 订货单列表
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItem35_Click(object sender, System.EventArgs e) {
Eboer.MIS.MF.WinForm.Sell.OrderList list = new OrderList();
list.MdiParent = this;
list.ListInit();
list.Show();
}
/* ---------------------------------- 控制窗体 --------------------- */
#region Private Structures
[StructLayout(LayoutKind.Sequential, Pack = 4)]
private struct RECT {
public int left;
public int top;
public int right;
public int bottom;
public override string ToString() {
string ret = string.Format(
"left = {0}, top = {1}, right = {2}, bottom = {3}",
left, top, right, bottom);
return ret;
}
}
[StructLayout(LayoutKind.Sequential, Pack = 4)]
private struct PAINTSTRUCT {
public IntPtr hdc;
public int fErase;
public RECT rcPaint;
public int fRestore;
public int fIncUpdate;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] public byte[] rgbReserved;
public override string ToString() {
string ret = string.Format(
"hdc = {0} , fErase = {1}, rcPaint = {2}, fRestore = {3}, fIncUpdate = {4}",
hdc, fErase, rcPaint.ToString(), fRestore, fIncUpdate);
return ret;
}
}
#endregion
#region UnManagedMethods
private class UnManagedMethods {
[DllImport("user32")]
public extern static int GetClientRect(
IntPtr hwnd,
ref RECT lpRect);
[DllImport("user32")]
public extern static int BeginPaint(
IntPtr hwnd,
ref PAINTSTRUCT lpPaint);
[DllImport("user32")]
public extern static int EndPaint(
IntPtr hwnd,
ref PAINTSTRUCT lpPaint);
[DllImport("user32", CharSet = CharSet.Auto)]
public extern static uint SetClassLong (
IntPtr hwnd,
int nIndex ,
uint dwNewLong);
[DllImport("user32")]
public extern static int InvalidateRect (
IntPtr hwnd,
ref RECT lpRect,
int bErase);
public const int WM_PAINT = 0xF;
public const int WM_ERASEBKGND = 0x14;
public const int WM_SIZE = 0x5;
public const int GCL_HBRBACKGROUND = (-10);
}
#endregion
#region MDI Background Painting
public void WndProc(ref Message m, ref bool doDefault) {
if (this.WindowState != FormWindowState.Minimized) {
if (m.Msg == UnManagedMethods.WM_PAINT) {
PAINTSTRUCT ps = new PAINTSTRUCT();
UnManagedMethods.BeginPaint(m.HWnd, ref ps);
RECT rc = new RECT();
UnManagedMethods.GetClientRect(m.HWnd, ref rc);
Graphics gfx = Graphics.FromHdc(ps.hdc);
RectangleF rcClient = new RectangleF(
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
Rectangle rcPaint = new Rectangle(
ps.rcPaint.left,
ps.rcPaint.top,
ps.rcPaint.right - ps.rcPaint.left,
ps.rcPaint.bottom - ps.rcPaint.top);
SolidBrush brText = new SolidBrush(Color.White);
StringFormat strFormat = new StringFormat();
strFormat.Alignment = StringAlignment.Far;
strFormat.FormatFlags = StringFormatFlags.DirectionVertical |
StringFormatFlags.NoWrap;
strFormat.LineAlignment = StringAlignment.Far;
Font logoFont = new Font(this.Font.FontFamily, 20, FontStyle.Bold);
gfx.DrawString(this.Text, logoFont, brText, rcClient, strFormat);
logoFont.Dispose();
strFormat.Dispose();
brText.Dispose();
gfx.Dispose();
UnManagedMethods.EndPaint(m.HWnd, ref ps);
}
else if (m.Msg == UnManagedMethods.WM_ERASEBKGND) {
RECT rc = new RECT();
UnManagedMethods.GetClientRect(m.HWnd, ref rc);
Graphics gfx = Graphics.FromHdc(m.WParam);
Rectangle rcClient = new Rectangle(
rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
int angle = 45;
LinearGradientBrush linGrBrush = new LinearGradientBrush(
rcClient,
Color.FromArgb(255, 230, 242, 255),// pale blue
Color.FromArgb(255, 0, 72, 160), // deep blue
angle);
gfx.FillRectangle(linGrBrush, rcClient);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -