我遇到的问题是,当调用UpdateUI()并遍历该数组时,会调整向导当前步骤的标题文本,确保所有非活动步骤都被隐藏,并确保活动步骤可见,处于正确的位置和正确的大小。
以下是代码:
private void UpdateUI()
{
// If the StepIndex equals the array length, that's our cue
// to exit.
if (StepIndex == Steps.Length)
{
Application.Exit();
return;
}
for (var xx = 0; xx < Steps.Length; xx++)
{
if (xx == StepIndex)
{
if (!String.IsNullOrEmpty(Steps[xx].Title))
{
LabelStepTitle.ForeColor = SystemColors.ControlText;
LabelStepTitle.Text = Steps[xx].Title;
}
else
{
LabelStepTitle.ForeColor = Color.Red;
LabelStepTitle.Text =
Resources.UiWarning_StepTitleNotSet;
}
}
else
{
Steps[xx].Visible = false;
}
}
Steps[StepIndex].Top = 50;
Steps[StepIndex].Left = 168;
Steps[StepIndex].Width = 414;
Steps[StepIndex].Height = 281;
Steps[StepIndex].Visible = true;
SetNavigationButtonState(true);
}
当一切结束时,Steps[StepIndex].Visible == false。
我仍然感到困惑,因为不到30分钟之前我还在工作。
SetNavigationButtonState
是用来做什么的? - Paulo Santos