Esempio n. 1
0
 protected override void DrawButton(DevExpress.XtraEditors.ViewInfo.ButtonEditViewInfo viewInfo, EditorButtonObjectInfoArgs info)
 {
     base.DrawButton(viewInfo, info);
     if (info.Button.Kind == DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)
     {
         Bitmap bmp = new Bitmap(SystemIcons.Information.ToBitmap(), info.Bounds.Width, info.Bounds.Height);
         info.Graphics.DrawImageUnscaled(bmp, info.Bounds);
     }
 }
 protected override void DrawButton(DevExpress.XtraEditors.ViewInfo.ButtonEditViewInfo viewInfo, EditorButtonObjectInfoArgs info)
 {
     if ("IsImage".Equals(info.Button.Tag))
     {
         Rectangle bounds = info.Bounds;
         info.Graphics.FillRectangle(viewInfo.PaintAppearance.GetBackBrush(info.Cache), info.Bounds);
         bounds.Inflate(-3, -3);
         info.Graphics.DrawImage(info.Button.Image, bounds);
     }
     else
     {
         base.DrawButton(viewInfo, info);
     }
 }
Esempio n. 3
0
        private void gridView2_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
        {
            var myView = sender as DevExpress.XtraGrid.Views.Grid.GridView;
            var dr     = myView.GetRow(e.RowHandle) as MIAccountPosition;

            if (dr == null)
            {
                return;
            }

            //操作
            if (e.Column.Name == colOperate.Name)
            {
                DevExpress.XtraEditors.ViewInfo.ButtonEditViewInfo buttonVI = (DevExpress.XtraEditors.ViewInfo.ButtonEditViewInfo)((DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo)e.Cell).ViewInfo;

                buttonVI.RightButtons[0].Button.Enabled = true;
                buttonVI.RightButtons[0].State          = DevExpress.Utils.Drawing.ObjectState.Normal;
            }
        }