DHDHSoftware/CanFly/UI/BaseFrmGuide.cs
2025-03-16 17:32:09 +08:00

54 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CanFly.UI
{
public partial class BaseFrmGuide : Form
{
public BaseFrmGuide()
{
InitializeComponent();
// 处理 Panel 的大小变化事件,以动态更新控件宽度
panelMain.SizeChanged += PanelMain_SizeChanged; ;
}
private void PanelMain_SizeChanged(object? sender, EventArgs e)
{
foreach (Control control in flowPanelContent.Controls)
{
control.Width = panelMain.Width - 6; // 根据 Panel 的宽度调整控件
}
}
public void SetTitle(string title)
{
this.lblTitle.Text = title;
}
public void SetLogo(Image logo)
{
this.pbLogo.BackgroundImage = logo;
this.pbLogo.SizeMode = PictureBoxSizeMode.StretchImage;
this.pbLogo.Refresh();
}
private void BaseFrmGuide_Load(object sender, EventArgs e)
{
}
}
}