示例#1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public UIControl()
 {
     Version          = UIGlobal.Version;
     base.Font        = UIFontColor.Font();
     Size             = new Size(100, 35);
     base.MinimumSize = new Size(1, 1);
 }
示例#2
0
 public UILabel()
 {
     base.Font         = UIFontColor.Font();
     Version           = UIGlobal.Version;
     base.TextAlign    = ContentAlignment.MiddleLeft;
     ForeColorChanged += UILabel_ForeColorChanged;
 }
示例#3
0
        public UIChart()
        {
            SetStyleFlags(true, false);
            ShowText  = false;
            fillColor = UIChartStyles.Plain.BackColor;
            foreColor = UIChartStyles.Plain.ForeColor;
            Width     = 400;
            Height    = 300;

            SubFont    = UIFontColor.SubFont();
            LegendFont = UIFontColor.SubFont();

            tip.Parent          = this;
            tip.Height          = 32;
            tip.Width           = 200;
            tip.Left            = 1;
            tip.Top             = 1;
            tip.StyleCustomMode = true;
            tip.Style           = UIStyle.Custom;
            tip.Font            = UIFontColor.SubFont();
            tip.RadiusSides     = UICornerRadiusSides.None;
            tip.Visible         = false;

            tip.FillColor       = UIChartStyles.Plain.BackColor;
            tip.RectColor       = UIChartStyles.Plain.ForeColor;
            tip.ForeColor       = UIChartStyles.Plain.ForeColor;
            tip.Visible         = false;
            tip.MouseEnter     += Tip_MouseEnter;
            tip.VisibleChanged += Tip_VisibleChanged;
        }
示例#4
0
        public UIDropControl()
        {
            InitializeComponent();
            SetStyleFlags();
            Padding = new Padding(0, 0, 30, 2);

            edit.Font         = UIFontColor.Font();
            edit.Left         = 3;
            edit.Top          = 3;
            edit.Text         = String.Empty;
            edit.ForeColor    = UIFontColor.Primary;
            edit.BorderStyle  = BorderStyle.None;
            edit.TextChanged += EditTextChanged;
            edit.KeyDown     += EditOnKeyDown;
            edit.KeyUp       += EditOnKeyUp;
            edit.KeyPress    += EditOnKeyPress;
            edit.LostFocus   += Edit_LostFocus;
            edit.Invalidate();
            Controls.Add(edit);

            TextAlignment  = ContentAlignment.MiddleLeft;
            fillColor      = Color.White;
            edit.BackColor = Color.White;
            MouseMove     += UIDropControl_MouseMove;
        }
示例#5
0
 public UIContextMenuStrip()
 {
     Font       = UIFontColor.Font();
     RenderMode = ToolStripRenderMode.Professional;
     Renderer   = new ToolStripProfessionalRenderer(ColorTable);
     Version    = UIGlobal.Version;
 }
示例#6
0
 public UILabel()
 {
     base.Font      = UIFontColor.Font();
     Version        = UIGlobal.Version;
     base.TextAlign = ContentAlignment.MiddleLeft;
     foreColor      = UIStyles.Blue.LabelForeColor;
 }
示例#7
0
        public UITabControl()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            DoubleBuffered = true;
            UpdateStyles();

            ItemSize = new Size(150, 40);
            DrawMode = TabDrawMode.OwnerDrawFixed;
            Font     = UIFontColor.Font();
            AfterSetFillColor(FillColor);
            Version = UIGlobal.Version;

            Helper         = new UITabControlHelper(this);
            timer          = new Timer();
            timer.Interval = 500;
            timer.Tick    += Timer_Tick;

            DisposeTabPageAfterRemove = true;
            AutoClosePage             = true;

            tabSelectedForeColor = UIStyles.Blue.TabControlTabSelectedColor;
            tabSelectedHighColor = UIStyles.Blue.TabControlTabSelectedColor;
            _fillColor           = UIStyles.Blue.TabControlBackColor;
        }
示例#8
0
 public UIPanel()
 {
     InitializeComponent();
     base.Font        = UIFontColor.Font();
     base.MinimumSize = new System.Drawing.Size(1, 1);
     showText         = true;
     SetStyleFlags(true, false);
 }
示例#9
0
 public UIUserControl()
 {
     InitializeComponent();
     Version          = UIGlobal.Version;
     AutoScaleMode    = AutoScaleMode.None;
     base.Font        = UIFontColor.Font();
     base.MinimumSize = new System.Drawing.Size(1, 1);
     SetStyleFlags(true, false);
 }
示例#10
0
 public UISmoothLabel()
 {
     base.Font      = UIFontColor.Font(36);
     Version        = UIGlobal.Version;
     drawPath       = new GraphicsPath();
     drawPen        = new Pen(new SolidBrush(rectColor), rectSize);
     forecolorBrush = new SolidBrush(ForeColor);
     Size           = new Size(300, 60);
 }
示例#11
0
        public UIDataGridView()
        {
            BackgroundColor     = UIColor.White;
            GridColor           = UIColor.Blue;
            base.Font           = UIFontColor.Font();
            base.DoubleBuffered = true;

            VBar.Parent          = this;
            VBar.Visible         = false;
            HBar.FillColor       = VBar.FillColor = UIColor.LightBlue;
            VBar.ForeColor       = UIColor.Blue;
            VBar.StyleCustomMode = true;
            VBar.ValueChanged   += VBarValueChanged;
            VBar.ShowLeftLine    = true;

            HBar.Parent          = this;
            HBar.Visible         = false;
            HBar.ForeColor       = UIColor.Blue;
            HBar.StyleCustomMode = true;
            HBar.ValueChanged   += HBar_ValueChanged;

            SetBarPosition();

            //支持自定义标题行风格
            EnableHeadersVisualStyles = false;

            //标题行风格
            ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
            ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            ColumnHeadersDefaultCellStyle.BackColor = UIColor.Blue;
            ColumnHeadersDefaultCellStyle.ForeColor = UIColor.White;
            ColumnHeadersDefaultCellStyle.WrapMode  = DataGridViewTriState.True;
            ColumnHeadersDefaultCellStyle.Font      = UIFontColor.Font();

            //行头部颜色
            RowHeadersDefaultCellStyle.BackColor          = UIColor.LightBlue;
            RowHeadersDefaultCellStyle.ForeColor          = UIFontColor.Primary;
            RowHeadersDefaultCellStyle.SelectionBackColor = UIColor.Blue;
            RowHeadersDefaultCellStyle.SelectionForeColor = Color.White;
            RowHeadersDefaultCellStyle.Font = UIFontColor.Font();

            RowsDefaultCellStyle.Font = UIFontColor.Font();
            DefaultCellStyle.Font     = UIFontColor.Font();

            //标题行行高,与OnColumnAdded事件配合
            ColumnHeadersHeight = 32;

            //设置奇偶数行颜色
            StripeEvenColor = UIColor.White;
            StripeOddColor  = UIColor.LightBlue;

            VerticalScrollBar.ValueChanged     += VerticalScrollBar_ValueChanged;
            HorizontalScrollBar.ValueChanged   += HorizontalScrollBar_ValueChanged;
            VerticalScrollBar.VisibleChanged   += VerticalScrollBar_VisibleChanged;
            HorizontalScrollBar.VisibleChanged += HorizontalScrollBar_VisibleChanged;
        }
示例#12
0
 public UIEdit()
 {
     //设置为单选边框
     BorderStyle    = BorderStyle.FixedSingle;
     base.Font      = UIFontColor.Font();
     base.ForeColor = UIFontColor.Primary;
     Width          = 150;
     base.MaxLength = 32767;
     JoinEvents(true);
 }
示例#13
0
        public UIContextMenuStrip()
        {
            Font       = UIFontColor.Font();
            RenderMode = ToolStripRenderMode.Professional;
            Renderer   = new ToolStripProfessionalRenderer(ColorTable);
            Version    = UIGlobal.Version;

            ColorTable.SetStyleColor(UIStyles.Blue);
            BackColor = UIStyles.Blue.ContextMenuColor;
        }
示例#14
0
        public UIDataGridViewFooter()
        {
            SetStyleFlags(true, false, true);
            Height      = 29;
            RadiusSides = UICornerRadiusSides.None;

            Font      = UIFontColor.Font();
            foreColor = UIStyles.Blue.DataGridViewFooterForeColor;
            fillColor = UIStyles.Blue.PlainColor;
            rectColor = UIStyles.Blue.RectColor;
        }
示例#15
0
        public UIDataGridViewFooter()
        {
            SetStyleFlags(true, false, true);
            Height      = 29;
            RadiusSides = UICornerRadiusSides.None;
            RectSides   = ToolStripStatusLabelBorderSides.None;

            Font      = UIFontColor.Font();
            foreColor = UIFontColor.Primary;
            fillColor = UIColor.LightBlue;
        }
示例#16
0
        public UITabControlMenu()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            DoubleBuffered = true;
            UpdateStyles();

            ItemSize = new Size(40, 200);
            DrawMode = TabDrawMode.OwnerDrawFixed;
            Font     = UIFontColor.Font();
            AfterSetFillColor(FillColor);
            Size    = new Size(450, 270);
            Version = UIGlobal.Version;
        }
示例#17
0
        public UIComboboxEx()
        {
            Version = UIGlobal.Version;

            base.Font      = UIFontColor.Font();
            base.ForeColor = UIFontColor.Primary;
            base.BackColor = Color.White;
            DrawMode       = DrawMode.OwnerDrawFixed;
            //FlatStyle = FlatStyle.Flat;

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            base.DoubleBuffered = true;
            this.DoubleBuffered();
            UpdateStyles();
            Width = 150;
        }
示例#18
0
文件: UINavBar.cs 项目: yhuse/SunnyUI
        public UINavBar()
        {
            InitializeComponent();

            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            //SetStyle(ControlStyles.ResizeRedraw, true);
            DoubleBuffered = true;
            UpdateStyles();
            Font = UIFontColor.Font();

            NavBarMenu.VisibleChanged += NavBarMenu_VisibleChanged;
            Dock    = DockStyle.Top;
            Width   = 500;
            Height  = 110;
            Version = UIGlobal.Version;
        }
示例#19
0
        public UINavMenu()
        {
            SetStyle(ControlStyles.DoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();

            BorderStyle = BorderStyle.None;
            //HideSelection = false;
            DrawMode      = TreeViewDrawMode.OwnerDrawAll;
            FullRowSelect = true;
            ShowLines     = false;
            //ShowPlusMinus = false;
            //ShowRootLines = false;

            DoubleBuffered = true;
            Font           = UIFontColor.Font();
            //CheckBoxes = false;
            ItemHeight = 50;
            BackColor  = Color.FromArgb(56, 56, 56);

            Bar.ValueChanged   += Bar_ValueChanged;
            Bar.Dock            = DockStyle.Right;
            Bar.Visible         = false;
            Bar.Style           = UIStyle.Custom;
            Bar.StyleCustomMode = true;
            Bar.FillColor       = fillColor;

            Bar.ForeColor         = Color.Silver;
            Bar.HoverColor        = Color.Silver;
            Bar.PressColor        = Color.Silver;
            Bar.ZoomScaleDisabled = true;

            Controls.Add(Bar);
            Version = UIGlobal.Version;
            SetScrollInfo();

            selectedForeColor = UIStyles.Blue.NavMenuMenuSelectedColor;
            selectedHighColor = UIStyles.Blue.NavMenuMenuSelectedColor;
        }
示例#20
0
        public UITextBox()
        {
            InitializeComponent();
            InitializeComponentEnd = true;
            SetStyleFlags();

            ShowText    = false;
            Font        = UIFontColor.Font();
            Padding     = new Padding(0);
            MinimumSize = new Size(1, 16);

            Width  = 150;
            Height = 29;

            edit.AutoSize     = false;
            edit.Top          = (Height - edit.Height) / 2;
            edit.Left         = 4;
            edit.Width        = Width - 8;
            edit.Text         = String.Empty;
            edit.BorderStyle  = BorderStyle.None;
            edit.TextChanged += Edit_TextChanged;
            edit.KeyDown     += Edit_OnKeyDown;
            edit.KeyUp       += Edit_OnKeyUp;
            edit.KeyPress    += Edit_OnKeyPress;
            edit.MouseEnter  += Edit_MouseEnter;
            edit.Click       += Edit_Click;
            edit.DoubleClick += Edit_DoubleClick;
            edit.Leave       += Edit_Leave;
            edit.Validated   += Edit_Validated;
            edit.Validating  += Edit_Validating;
            edit.GotFocus    += Edit_GotFocus;
            edit.LostFocus   += Edit_LostFocus;
            edit.MouseLeave  += Edit_MouseLeave;
            edit.MouseWheel  += Edit_MouseWheel;
            edit.MouseDown   += Edit_MouseDown;
            edit.MouseUp     += Edit_MouseUp;
            edit.MouseMove   += Edit_MouseMove;

            btn.Parent       = this;
            btn.Visible      = false;
            btn.Text         = "";
            btn.Symbol       = 361761;
            btn.SymbolOffset = new Point(0, 1);
            btn.Top          = 1;
            btn.Height       = 25;
            btn.Width        = 29;
            btn.BackColor    = Color.Transparent;
            btn.Click       += Btn_Click;
            btn.Radius       = 3;

            edit.Invalidate();
            Controls.Add(edit);
            fillColor = Color.White;

            bar.Parent        = this;
            bar.Dock          = DockStyle.None;
            bar.Style         = UIStyle.Custom;
            bar.Visible       = false;
            bar.ValueChanged += Bar_ValueChanged;
            bar.MouseEnter   += Bar_MouseEnter;
            TextAlignment     = ContentAlignment.MiddleLeft;

            SizeChange();

            editCursor           = Cursor;
            TextAlignmentChange += UITextBox_TextAlignmentChange;
        }