// initialize default settings for all properties in static ctor static PictureBoxStyleProperties() { // all properties must be initialized for the Default property defaultObject = new PictureBoxStyleProperties(GridStyleInfo.Default); defaultObject.SizeMode = PictureBoxSizeMode.Normal; defaultObject.Image = null; }
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; }
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)); }
public PictureBoxCellModel(GridModel grid) : base(grid) { PictureBoxStyleProperties.Initialize(); }