Handles displaying grid this is not enabled

Added MyDisablePanel vlnPanel control
Added ApplDisplayMode property to StepPanel class
Added vlnPanel class
This commit is contained in:
Rich
2012-12-04 23:08:43 +00:00
parent 2549984e63
commit d29f45d322
5 changed files with 138 additions and 3 deletions

View File

@@ -360,7 +360,44 @@ namespace Volian.Controls.Library
#endregion
#region Override Method and Properties
public override int BorderWidth { get { return (MyFlexGrid.Width - MyFlexGrid.ClientRectangle.Width); } }
//private bool _OnlyOnce = false;
//protected override void OnPaint(PaintEventArgs e)
//{
// base.OnPaint(e);
// if (!this.Enabled && !_OnlyOnce)
// {
// _OnlyOnce = true;
// _MyDisablePanel.SendToBack();
// _MyDisablePanel.BringToFront();
// _OnlyOnce = false;
// }
//}
protected override void OnEnabledChanged(EventArgs e)
{
base.OnEnabledChanged(e);
if (this.Enabled)
{
_MyDisablePanel.SendToBack();
_MyDisablePanel.Visible = false;
}
else
{
_MyDisablePanel.Visible = true;
Rectangle rect = new Rectangle(0, 0, this.MyFlexGrid.Width, this.MyFlexGrid.Height);
Bitmap bmp = new Bitmap(this.MyFlexGrid.Width, this.MyFlexGrid.Height);
this.MyFlexGrid.DrawToBitmap(bmp, rect);
using (Graphics gr = Graphics.FromImage(bmp))
{
gr.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
gr.FillRectangle(new SolidBrush(Color.FromArgb(128, Color.FromKnownColor(KnownColor.ButtonFace))), rect);
//gr.FillEllipse(Brushes.Red, 10, 10, 10, 10);
}
_MyDisablePanel.Location = this.MyFlexGrid.Location;
_MyDisablePanel.Size = this.MyFlexGrid.Size;
_MyDisablePanel.BackgroundImage = bmp;
_MyDisablePanel.BringToFront();
}
}
public override Point ContentLocation
{
get { return new Point(Location.X + MyFlexGrid.Left, Location.Y); }