Moving form now updates splitter bounds

This commit is contained in:
Robin 2015-09-20 10:38:26 +01:00
parent dc79f4dcef
commit 8aa5d67d6e
2 changed files with 18 additions and 2 deletions

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
@ -12,6 +11,8 @@ namespace DarkUI
#region Field Region
private List<DarkDockGroup> _groups;
private Form _parentForm;
private DarkDockSplitter _splitter;
#endregion
@ -191,6 +192,20 @@ namespace DarkUI
#region Event Handler Region
protected override void OnCreateControl()
{
base.OnCreateControl();
_parentForm = FindForm();
_parentForm.ResizeEnd += ParentForm_ResizeEnd;
}
private void ParentForm_ResizeEnd(object sender, System.EventArgs e)
{
if (_splitter != null)
_splitter.UpdateBounds();
}
protected override void OnLayout(LayoutEventArgs e)
{
base.OnLayout(e);

View File

@ -19,6 +19,7 @@ namespace DarkUI
public DarkTranslucentForm(Color backColor, double opacity = 0.6)
{
FormBorderStyle = FormBorderStyle.None;
Size = new Size(0, 0);
ShowInTaskbar = false;
AllowTransparency = true;
Opacity = opacity;