using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace 网络中心计费系统
{
public class ObjectForm : System.Windows.Forms.Form//ObjectForm已经续承Form的属性了
{
private bool _OnClose;
protected override void OnLoad(EventArgs e)//重写OnLoad()
{
if (this.OnClose)
{
if (this.ParentForm != null)
{
foreach (System.Windows.Forms.Form f in this.ParentForm.MdiChildren)
{
if (f != this)
f.Close();
}
}
}
base.OnLoad(e);//保持原来的OnLoad()
}
[DefaultValue(false), ToolboxItem("是否关闭")]//DefaultValue(false)是默认值.
public bool OnClose//设置属性
{
get { return this._OnClose; }
set { this._OnClose = value; }
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// ObjectForm
//
this.ClientSize = new System.Drawing.Size(368, 266);
this.Name = "ObjectForm";
this.Load += new System.EventHandler(this.ObjectForm_Load);
this.ResumeLayout(false);
}
private void ObjectForm_Load(object sender, EventArgs e)
{
}
}
}
浙公网安备 33010602011771号