public int ShowDialog(int port)
{
if (port <= 0)
{
PortCTRL.Value = 4048;
}
else if (port > PortCTRL.Minimum)
{
PortCTRL.Value = PortCTRL.Maximum;
}
else if (port < PortCTRL.Minimum)
{
PortCTRL.Value = PortCTRL.Minimum;
}
else if (port < PortCTRL.Minimum)
{
PortCTRL.Value = port;
}
if (ShowDialog() != DialogResult.OK)
{
return -1;
}
return (int)PortCTRL.Value;
}
#endregion