2021-02-27 14:49:44 +00:00
|
|
|
|
using MGdu.WinFormUI;
|
|
|
|
|
|
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 VSoft.Skins
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class SKinForm : GMForm
|
|
|
|
|
|
{
|
|
|
|
|
|
public SKinForm()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
public SKinForm(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
2021-07-05 13:44:33 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 显示在父窗体中间,如果没有父窗体,则显示在显示器中间
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parent"></param>
|
|
|
|
|
|
public void ShowInCenter(Form parent)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.StartPosition = FormStartPosition.Manual;
|
|
|
|
|
|
var screen = Screen.FromControl(this);
|
|
|
|
|
|
if (parent == null) //如果没有父窗体,则显示在显示器中间
|
|
|
|
|
|
{
|
|
|
|
|
|
Location = new Point((screen.WorkingArea.Width - Width) / 2, (screen.WorkingArea.Height - Height) / 2);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
var x = parent.Left + (parent.Width - Width) / 2;
|
|
|
|
|
|
var y = parent.Top + (parent.Height - Height) / 2;
|
|
|
|
|
|
if ((x + Width) > screen.WorkingArea.X + screen.WorkingArea.Width)
|
|
|
|
|
|
{
|
|
|
|
|
|
x = screen.WorkingArea.X + screen.WorkingArea.Width - Width;
|
|
|
|
|
|
}
|
|
|
|
|
|
if ((y + Height) > screen.WorkingArea.Y + screen.WorkingArea.Height)
|
|
|
|
|
|
{
|
|
|
|
|
|
y = screen.WorkingArea.Y + screen.WorkingArea.Height - Height;
|
|
|
|
|
|
}
|
|
|
|
|
|
Location = new Point(x, y);
|
|
|
|
|
|
}
|
2021-02-27 14:49:44 +00:00
|
|
|
|
private void SKinForm_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!this.DesignMode)
|
|
|
|
|
|
{ base.XTheme = new VSoft.Skins.ThemeForm(); }
|
2021-03-06 14:33:09 +00:00
|
|
|
|
//Opacity = 0.97;
|
2021-02-27 14:49:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|