* UIDataGridView:修改DataSource赋值后Column改变引起的水平滚动条错误

This commit is contained in:
Sunny 2020-10-19 21:01:53 +08:00
parent 3317cb65ae
commit b4a2dc89e6
5 changed files with 20 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -105,6 +105,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1024, 720);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(1366, 728);
this.MinimumSize = new System.Drawing.Size(1024, 720);
this.Name = "FMain";
this.Padding = new System.Windows.Forms.Padding(2, 35, 2, 2);

View File

@ -232,6 +232,18 @@ namespace Sunny.UI
SetBarPosition();
}
protected override void OnColumnStateChanged(DataGridViewColumnStateChangedEventArgs e)
{
base.OnColumnStateChanged(e);
SetScrollInfo();
}
protected override void OnColumnRemoved(DataGridViewColumnEventArgs e)
{
base.OnColumnRemoved(e);
SetScrollInfo();
}
private void SetBarPosition()
{
if (ShowRect)
@ -273,6 +285,8 @@ namespace Sunny.UI
{
ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
}
SetScrollInfo();
}
private UIStyle _style = UIStyle.Blue;

View File

@ -53,7 +53,7 @@ namespace Sunny.UI
return bmp;
}
public static ImageList GetToolbarImageList(Type type, Bitmap bitmap, Size imageSize, Color transparentColor)
public static ImageList GetToolbarImageList(Type type, Image bitmap, Size imageSize, Color transparentColor)
{
ImageList imageList = new ImageList();
imageList.ImageSize = imageSize;
@ -63,7 +63,7 @@ namespace Sunny.UI
return imageList;
}
public static Bitmap Split(this Bitmap image, int size, UIShape shape)
public static Bitmap Split(this Image image, int size, UIShape shape)
{
//截图画板
Bitmap result = new Bitmap(size, size);
@ -94,7 +94,7 @@ namespace Sunny.UI
return result;
}
public static Bitmap Split(this Bitmap image, GraphicsPath path)
public static Bitmap Split(this Image image, GraphicsPath path)
{
//截图画板
Bitmap result = new Bitmap(image.Width, image.Height);
@ -201,7 +201,7 @@ namespace Sunny.UI
/// <param name="angle">角度</param>
/// <param name="bkColor">背景色</param>
/// <returns>图片</returns>
public static Bitmap Rotate(this Bitmap bmp, float angle, Color bkColor)
public static Bitmap Rotate(this Image bmp, float angle, Color bkColor)
{
int w = bmp.Width;
int h = bmp.Height;
@ -314,7 +314,7 @@ namespace Sunny.UI
/// <param name="newW">宽度</param>
/// <param name="newH">高度</param>
/// <returns>新图片</returns>
public static Bitmap ResizeImage(this Bitmap bmp, int newW, int newH)
public static Bitmap ResizeImage(this Image bmp, int newW, int newH)
{
if (bmp == null)
{