尺寸测量功能界面
This commit is contained in:
41
CanFly/Util/FormUtils.cs
Normal file
41
CanFly/Util/FormUtils.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CanFly.Util
|
||||
{
|
||||
public static class FormUtils
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 显示窗体
|
||||
/// </summary>
|
||||
/// <param name="panel"></param>
|
||||
/// <param name="frm"></param>
|
||||
public static void ShowForm(this Panel panel, Form frm)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
frm.TopLevel = false;
|
||||
panel.Controls.Clear();
|
||||
panel.Controls.Add(frm);
|
||||
frm.Show();
|
||||
frm.Dock = DockStyle.Fill;
|
||||
panel.Refresh();
|
||||
foreach (Control item in frm.Controls)
|
||||
{
|
||||
item.Focus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user