-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawEditorHelper.cs
51 lines (46 loc) · 1.72 KB
/
DrawEditorHelper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Developer Express Code Central Example:
// How to place controls in a LayoutControl's tabbed group header
//
// By default, it is not possible to place any control within a tabbed group
// header, because the LayoutControl's layout can be widely customized (groups can
// be moved and hidden, their direction can be changed). However, you can emulate
// controls by custom drawing them. This example demonstrates how to draw a
// CheckBox and ProgressBar in headers.
//
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E2811
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraLayout.Registrator;
using DevExpress.XtraLayout;
using DevExpress.LookAndFeel;
using DevExpress.XtraLayout.Painting;
using DevExpress.XtraLayout.ViewInfo;
using DevExpress.Utils.Drawing;
using DevExpress.Skins;
using DevExpress.Utils;
using DevExpress.XtraEditors.Drawing;
using DevExpress.XtraEditors.ViewInfo;
using DevExpress.XtraEditors.Repository;
namespace WindowsApplication1
{
public static class DrawEditorHelper
{
public static void DrawEdit(Graphics g, RepositoryItem edit, Rectangle r, object value)
{
BaseEditViewInfo info = edit.CreateViewInfo() as BaseEditViewInfo;
BaseEditPainter painter = edit.CreatePainter();
info.EditValue = value;
info.Bounds = r;
info.CalcViewInfo(g);
ControlGraphicsInfoArgs args = new ControlGraphicsInfoArgs(info, new GraphicsCache(g), r);
painter.Draw(args);
args.Cache.Dispose();
}
}
}