Files
Groupware/SubProject/FCOMMON/fBase.cs
2022-01-18 21:54:44 +09:00

53 lines
1.5 KiB
C#

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 FCOMMON
{
public partial class fBase : Form
{
public Boolean UseFormSetting { get; set; }
public fBase()
{
InitializeComponent();
this.KeyPreview = true;
UseFormSetting = true;
this.FormClosed += fBase_FormClosed;
this.KeyDown += fBase_KeyDown;
}
void fBase_KeyDown(object sender, KeyEventArgs e)
{
//if (e.KeyCode == Keys.Escape) this.Close();
}
void fBase_FormClosed(object sender, FormClosedEventArgs e)
{
if(UseFormSetting)
{
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, false);
}
}
private void fBase_Load(object sender, EventArgs e)
{
if(UseFormSetting)
{
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, true);
}
if (this.WindowState == FormWindowState.Minimized) this.WindowState = FormWindowState.Normal;
if (this.RestoreBounds.X + this.RestoreBounds.Width < 300 && this.RestoreBounds.X < 0)
this.Location = new Point(0, 0);
}
}
}