更新
This commit is contained in:
@@ -42,6 +42,16 @@ namespace WindowsFormsApp6
|
||||
private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateTitleForCurrentTab();
|
||||
|
||||
// 根据选中的 Tab 显示/隐藏切换布局按钮
|
||||
// 只有在 Form3 (Tab 2, index=2) 时显示切换按钮
|
||||
buttonToggleLayout.Visible = (tabControl1.SelectedIndex == 2);
|
||||
|
||||
// 更新切换按钮的文本
|
||||
if (tabControl1.SelectedIndex == 2 && form3Instance != null)
|
||||
{
|
||||
UpdateToggleButtonText();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTitleForCurrentTab()
|
||||
@@ -132,6 +142,31 @@ namespace WindowsFormsApp6
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonToggleLayout_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (form3Instance != null)
|
||||
{
|
||||
// 调用 Form3 的公共切换方法
|
||||
form3Instance.ToggleTableLayout();
|
||||
|
||||
// 更新按钮文本
|
||||
UpdateToggleButtonText();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新切换按钮的文本
|
||||
/// </summary>
|
||||
private void UpdateToggleButtonText()
|
||||
{
|
||||
if (form3Instance != null)
|
||||
{
|
||||
// 使用公共方法获取布局状态
|
||||
bool isVertical = form3Instance.IsVerticalLayout();
|
||||
buttonToggleLayout.Text = isVertical ? "🔄 横向布局" : "🔄 纵向布局";
|
||||
}
|
||||
}
|
||||
|
||||
private void ExportIntegratedReport(string filePath)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user