* UIMainFrame: 修复了显示页面关闭按钮,移除最后一个页面出错的问题
This commit is contained in:
parent
31c41746d2
commit
db3eeb45f8
@ -296,6 +296,7 @@ namespace Sunny.UI
|
|||||||
public static List<T> GetControls<T>(this Control ctrl, bool includeChild = false) where T : Control
|
public static List<T> GetControls<T>(this Control ctrl, bool includeChild = false) where T : Control
|
||||||
{
|
{
|
||||||
List<T> values = new List<T>();
|
List<T> values = new List<T>();
|
||||||
|
if (ctrl.IsNull()) return values;
|
||||||
|
|
||||||
foreach (Control obj in ctrl.Controls)
|
foreach (Control obj in ctrl.Controls)
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*
|
*
|
||||||
* 2020-05-05: V2.2.5 页面框架基类
|
* 2020-05-05: V2.2.5 页面框架基类
|
||||||
* 2021-08-17: V3.0.8 删除IFrame接口,移到父类UIForm
|
* 2021-08-17: V3.0.8 删除IFrame接口,移到父类UIForm
|
||||||
|
* 2022-05-17: V3.1.9 修复了显示页面关闭按钮,移除最后一个页面出错的问题
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -89,7 +90,7 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
private void MainContainer_Selecting(object sender, TabControlCancelEventArgs e)
|
private void MainContainer_Selecting(object sender, TabControlCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (Selecting != null)
|
if (Selecting != null && e.TabPage != null)
|
||||||
{
|
{
|
||||||
List<UIPage> pages = e.TabPage.GetControls<UIPage>();
|
List<UIPage> pages = e.TabPage.GetControls<UIPage>();
|
||||||
Selecting?.Invoke(this, e, pages.Count == 0 ? null : pages[0]);
|
Selecting?.Invoke(this, e, pages.Count == 0 ? null : pages[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user