123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.ComponentLibrary
- {
- public partial class BaseFormRelease : BaseForm360
- {
- public BaseFormRelease()
- {
- InitializeComponent();
- this.btnAppFormMenu.MouseClick += new MouseEventHandler(btnAppFormMenu_MouseClick);
- this.Load += BaseFormRelease_Load;
-
- this.BackColor = LYFZ.ComponentLibrary.GetUIResources.FrmContentBackgroundColor;
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
- }
- bool isLoginValidation = false;
- /// <summary>
- /// 是否进行登录验证
- /// </summary>
- public bool IsLoginValidation
- {
- get { return isLoginValidation; }
- set { isLoginValidation = value; }
- }
- /// <summary>
- /// 登录超时提醒
- /// </summary>
- void LoginMessageBoxCustom(bool isMessageBoxCustom = true)
- {
- try
- {
- if (isMessageBoxCustom)
- {
- MessageBox.Show("用户登录超时,请重新登录。", "提示");
- this.Close();
- }
- }
- catch { }
- }
- void BaseFormRelease_Load(object sender, EventArgs e)
- {
- this.plFormMainContent.BackColor = LYFZ.ComponentLibrary.GetUIResources.FrmContentBackgroundColor;
- }
- /// <summary>
- /// 是否覆盖基窗体的OnPaint
- /// </summary>
- protected bool isOverrideOnPaint = false;
- protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
- {
- base.OnPaint(e);
- if (!isOverrideOnPaint)
- {
- this.plFormMainContent.Location = new Point(0, this.TitleBgImageHeight);
- this.plFormMainContent.Width = this.Width;
- this.plFormMainContent.Height = this.Height - this.TitleBgImageHeight - this.BottomBgImageHeight;
- }
-
- }
-
- /// <summary>
- /// 显示系统菜单
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnAppFormMenu_MouseClick(object sender, MouseEventArgs e)
- {
- Button btn = sender as Button;
- Point point = new Point();
- point.Y = btn.Height;
- if (e.Button == MouseButtons.Left)
- {
- this.cmsSystemMeunList.Show(btn, point);
- }
- }
- static bool isRights = false;
- /// <summary>
- /// 是否开启权限控制
- /// </summary>
- public static bool IsRights
- {
- get { return BaseFormRelease.isRights; }
- set { BaseFormRelease.isRights = value; }
- }
-
-
- /// <summary>
- /// 设置菜单项单击事件 要在派生窗体中重写实现功能
- /// </summary>
- /// <param name="menuItem"></param>
- protected virtual void SetMenuItem_Click(ToolStripMenuItem menuItem)
- {
- //请在派生窗体中重写实现功能
- }
-
-
- /// <summary>
- /// 是否重写系统菜单
- /// </summary>
- public bool IsOverrideSystemMeun = false;
-
- protected override void CreateHandle()
- {
- if (!IsHandleCreated)
- {
- try
- {
- base.CreateHandle();
- }
- catch { }
- finally
- {
- if (!IsHandleCreated)
- {
- base.RecreateHandle();
- }
- }
- }
- }
- }
- }
|