wCtrl.cs
using System; using System.Drawing; using System.Windows.Forms; public class WCtrl { protected Control ctrl; protected int fontSize = 0; protected WCtrl() { } protected WCtrl(int size) { fontSize = size; } public Control getCtrl() { return ctrl; } public Control getParent() { return ctrl.Parent; } public void SetSize( Size size ) { this.ctrl.Size = size; } public void setSize( Size size ) { this.ctrl.Size = size; } public void SetLocation( Point point ) { this.ctrl.Location = point; } public void dockTop() { this.ctrl.Dock = DockStyle.Top; } public void dockBottom() { this.ctrl.Dock = DockStyle.Bottom; } public void dockLeft() { this.ctrl.Dock = DockStyle.Left; } public void dockRight() { this.ctrl.Dock = DockStyle.Right; } public void dockFill() { this.ctrl.Dock = DockStyle.Fill; } public void anchorAll() { this.ctrl.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; } virtual public void Add(Control ctl) { ctrl.Controls.Add(ctl); } public void SetBackColor(Color color) { ctrl.BackColor = color; } public void SetBackImage(Image image) { ctrl.BackgroundImage = image; } public void SetBackImage(string filename) { ctrl.BackgroundImage = new Bitmap(filename); } public void SetBounds(Rectangle bounds) { ctrl.Bounds = bounds; } public void Invalidate() { ctrl.Invalidate(); } public void SetTabIndex(int i ) { ctrl.TabIndex = i; } public void SetFontSize(int size) { if( size > 0 ) { ctrl.Font = new Font(ctrl.Font.Name, size, ctrl.Font.Style, ctrl.Font.Unit); } } public float GetFontSize(int size) { return ctrl.Font.Size; } };
댓글 없음:
댓글 쓰기