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:
@@ -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); }
|
||||
|
Reference in New Issue
Block a user