Exemplo n.º 1
0
 public static Size? GetSize(Size? size)
 {
     var form = new SelectSizeForm();
     if (size != null)
     {
         form.controlWidth.Value = size.Value.Width;
         form.controlHeight.Value = size.Value.Height;
     }
     else
     {
         form.controlWidth.Value = 40;
         form.controlHeight.Value = 30;
     }
     var res = form.ShowDialog();
     if (res != DialogResult.OK)
         return null;
     return new Size((int) form.controlWidth.Value, (int) form.controlHeight.Value);
 }
Exemplo n.º 2
0
        public static Size?GetSize(Size?size)
        {
            var form = new SelectSizeForm();

            if (size != null)
            {
                form.controlWidth.Value  = size.Value.Width;
                form.controlHeight.Value = size.Value.Height;
            }
            else
            {
                form.controlWidth.Value  = 40;
                form.controlHeight.Value = 30;
            }
            var res = form.ShowDialog();

            if (res != DialogResult.OK)
            {
                return(null);
            }
            return(new Size((int)form.controlWidth.Value, (int)form.controlHeight.Value));
        }