📄 splashform.cs
字号:
// DINAMIC XML Editor
//
// Copyright (c) 2002-2003 Dusan Hlavaty
// mailto: duddo@atlas.cz
//
// This software is licensed under the terms of
// GNU General Public license
//
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace XML_editor.MyForms
{
/// <summary>
/// Formular zobrazujuci splash screen
/// </summary>
public class SplashForm : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
/// <summary>
/// Timer
/// </summary>
private System.Windows.Forms.Timer timer;
/// <summary>
/// <c>true</c> ak sa moze uz formular (pri kliknuti) zavriet ???
/// </summary>
private bool canDispose = false;
// -------------------------------------------------------------------------
/// <summary>
/// Inicializuje instanciu <see cref="SplashForm"/>
/// </summary>
public SplashForm()
{
this.MyInitializeComponent();
}
// -------------------------------------------------------------------------
/// <summary>
/// <c>true</c> ak sa moze uz formular (pri kliknuti) zavriet ???
/// </summary>
public bool CanDispose
{
get
{
return this.canDispose;
}
set
{
this.canDispose = value;
if (value == true)
{
this.timer.Start();
}
else
{
this.timer.Stop();
}
}
}
// -------------------------------------------------------------------------
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(this.components != null)
{
this.components.Dispose();
}
}
base.Dispose( disposing );
}
// -------------------------------------------------------------------------
/// <summary>
/// My Designer support
/// </summary>
private void MyInitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.timer = new System.Windows.Forms.Timer(this.components);
//
// timer
//
this.timer.Interval = 5000;
this.timer.Tick += new System.EventHandler(this.Clicked_SplashForm);
//
// SplashForm
//
this.MaximizeBox = false;
this.MinimizeBox = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.TopMost = true;
this.BackgroundImage = XML_editor.Common.IconProvider.LoadBitmap(this, "XML_editor.Icons.splash.png");
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Text = String.Empty;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(500, 300);
this.Click += new System.EventHandler(this.Clicked_SplashForm);
this.Activated += new System.EventHandler(this.Clicked_SplashForm);
}
// -----------------------------------------------------------------------
/// <summary>
/// Kliknutie na formular
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Clicked_SplashForm(object sender, System.EventArgs e)
{
if (this.CanDispose == true)
{
this.timer.Stop();
this.Close();
}
}
} // public class SplashForm : ...
} // namespace XML_editor.MyForms
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -