コード例 #1
0
 public static Thickness From(float leftInches, float topInches, float rightInches, float bottomInches)
 {
     Thickness ret = new Thickness();
     ret.Left = (int)Math.Round(leftInches * DpiX);
     ret.Right = (int)Math.Round(rightInches * DpiX);
     ret.Top = (int)Math.Round(topInches * DpiY);
     ret.Bottom = (int)Math.Round(bottomInches * DpiY);
     return ret;
 }
コード例 #2
0
 public WindowlessControl(Thickness padding)
     : this()
 {
     Margin = padding;
 }
コード例 #3
0
            public ImageResourcePresenter()
            {
                // spacing between images
                Margin = new Thickness(5, 5, 5, 5);
                // limit the maximum size of an item
                MaxWidth = 100;
                MaxHeight = 100;
                // stretch to fit
                HorizontalAlignment = WindowlessControls.HorizontalAlignment.Stretch;
                VerticalAlignment = VerticalAlignment.Stretch;

                // allow a 5 pixel border between the image and the rectangular selected background
                myImage.Margin = new Thickness(5, 5, 5, 5);
                myImage.VerticalAlignment = VerticalAlignment.Center;
                myImage.HorizontalAlignment = WindowlessControls.HorizontalAlignment.Center;

                // set up the rectangle color and make it fill the region
                myRectangle.Color = SystemColors.Highlight;
                myRectangle.HorizontalAlignment = WindowlessControls.HorizontalAlignment.Stretch;
                myRectangle.VerticalAlignment = VerticalAlignment.Stretch;
                // the rectangle does not paint by default
                myRectangle.PaintSelf = false;

                Controls.Add(myRectangle);
                Controls.Add(myImage);
            }
コード例 #4
0
 public WindowlessUpDownArrows()
 {
     Margin = new Thickness(2, 2, 2, 2);
     MaxHeight = 13;
     MaxWidth = 12;
     HorizontalAlignment = HorizontalAlignment.Stretch;
     VerticalAlignment = VerticalAlignment.Stretch;
 }
コード例 #5
0
 public WindowlessImage(PlatformBitmap bitmap, Stretch stretch, Thickness margin)
     : this(bitmap, stretch)
 {
     Margin = margin;
 }
コード例 #6
0
 public DropdownLabel()
 {
     HorizontalAlignment = HorizontalAlignment.Stretch;
     Margin = new Thickness(1, 0, 1, 0);
 }