Esempio n. 1
0
        // initialize default settings for all properties in static ctor

        #endregion

        #region "Constructor"

        static PictureBoxStyleProperties()
        {
            // all properties must be initialized for the Default property
            defaultObject          = new PictureBoxStyleProperties(GridStyleInfo.Default);
            defaultObject.SizeMode = PictureBoxSizeMode.Normal;
            defaultObject.Image    = null;
        }
Esempio n. 2
0
        /// <summary>
        /// Initialize the oicture box.
        /// </summary>
        public static void InitializePictureBox(PictureBox c, GridStyleInfo style)
        {
            PictureBoxStyleProperties sp = new PictureBoxStyleProperties(style);

            c.SizeMode  = sp.SizeMode;
            c.Image     = sp.Image;
            c.BackColor = style.BackColor;
        }
Esempio n. 3
0
        protected override Size OnQueryPrefferedClientSize(Graphics g, int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds queryBounds)
        {
            PictureBoxStyleProperties sp = new PictureBoxStyleProperties(style);
            Image img = sp.Image;

            if (img != null)
            {
                return(img.Size);
            }
            return(base.OnQueryPrefferedClientSize(g, rowIndex, colIndex, style, queryBounds));
        }
Esempio n. 4
0
 public PictureBoxCellModel(GridModel grid)
     : base(grid)
 {
     PictureBoxStyleProperties.Initialize();
 }