B2018-062: PSI OK/Cancel buttons not visible on bottom if more than a few labels/values

This commit is contained in:
Kathy Ruffing 2018-05-24 14:32:58 +00:00
parent 89f046e792
commit a252b4da5b

View File

@ -108,12 +108,22 @@ namespace VEPROMS
this.panelPSI.AutoScroll = true; this.panelPSI.AutoScroll = true;
} }
else else
this.panelPSI.Height = maxy + 50; this.panelPSI.Height = maxy; // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined.
if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO") if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO")
{ {
btnOk.Location = new Point(maxx+70, 30); btnOk.Location = new Point(maxx+70, 30);
btnCancel.Location = new Point(maxx + 70, 60); btnCancel.Location = new Point(maxx + 70, 60);
} }
else if (btnOk.Location.Y < panelPSI.Location.Y + panelPSI.Height)
{
// B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined:
// Adjust location of buttons so that they have a larger Y than the panel that holds the labels/fields
// and adjust the dialog size if it's height is not enough.
btnOk.Location = new Point(btnOk.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10);
btnCancel.Location = new Point(btnCancel.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10);
if (this.Height < btnOk.Location.Y + btnOk.Size.Height + 10)
this.Height = btnOk.Location.Y + btnOk.Size.Height + 30;
}
} }
private void FieldStepRTB_Enter(object sender, EventArgs e) private void FieldStepRTB_Enter(object sender, EventArgs e)
{ {