示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ctrl"></param>
        /// <param name="image"></param>
        public static void SetImage(Control control, Image image)
        {
            if (control is IImageProperty)
            {
                IImageProperty imageProperty = control as IImageProperty;
                imageProperty.Image = image;
            }
#if !PocketPC
            else
            {
                control.BackgroundImage = image;
            }
#else
            if (control is Panel)
            {
                Panel panel = (Panel)control;
                panel.BackGroundImage = image;
            }
#endif
        }
示例#2
0
        /// <summary></summary>
        /// <param name="control"></param>
        /// <param name="style"></param>
        public static void SetBorderStyle(Panel panel, BorderType borderType)
        {
            BorderStyle borderStyle = BorderStyle.FixedSingle;

            switch (borderType)
            {
            case BorderType.NoBorder:
                borderStyle = BorderStyle.None;
                break;

            case BorderType.Thick:
                borderStyle = BorderStyle.Fixed3D;
                break;

            case BorderType.Thin:
                borderStyle = BorderStyle.FixedSingle;
                break;
            }

            panel.BorderStyle = borderStyle;
        }