精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
But if I add for example a grid to your panel and I Dock Fill that grid, the result is the grid partially hidden from the top part of your panel.例如,但是如果我添加网格到面板里,我使网格停靠且填充,网格的结果是在顶部面板的一部分里隐藏了部分。
Is it possible to "reduce" the "filling space" to take in account this issue?有可能“降低”“填充空间”会为这个问题负责?
Well that's right. I'll take this into account in a future version of this control.这是正确的。我会在以后的版本考虑这个问题。
But you can add a panel that will span over all the content area, set its anchor property to Left,Right,Top,Bottom and host your grid inside this panel, this will take care of the Dock.Fill issue. 但是,你可以添加一个小组,将在涵盖所有内容区域,设置它的Anchor属性为左,右,顶部,底部和举办这次面板内部网格,这将采取Dock.Fill问题的照顾
Ok adding another panel can works, but seems to be a workaround.可以添加另一个面板可以工作,这似乎是一个解决方案。I'm interested to know how to change the content area.我想知道如何更改内容区域
public override Rectangle DisplayRectangle
{
get
{
Rectangle r = base.DisplayRectangle;
// TODO: change r to eliminate header and/or border
return r;
}
}
Very good!I learned something new for me.Vote changed from 4 to 5.很好!我学到新的东西。表决改变为4至5。
This changes the displayarea of the pictureboxes too.这改变的是displayarea图片框。
It's not working for me anyway...它不是为我工作。
I guess i'll draw a silly panel above the header...我想我会画头球高出一个愚蠢的面板
In case anyone is interested I used Spectre2x's response and came up with this:如果有人感兴趣,我使用Spectre2x想出了这个:
public override Rectangle DisplayRectangle
{
get
{
int h = base.Height - (pnlHeader.Height + 2);
Rectangle r = base.DisplayRectangle;
r.Height = h;
int y = r.Location.Y + pnlHeader.Height + 2;
r.Location = new Point(r.X, y);
return r;
}
}
I also added HeaderColor1 and HeaderColor2 so the header color could be changed and HeaderGradient to change the linearGradientMode. I also added HeaderHeight. 我还添加了HeaderColor1和HeaderColor2所以标题颜色可以改变,HeaderGradient改变线性渐变模式。我还添加了HeaderHeight。
[Category("CollapsiblePanel")]
[Description("Header Gradient First Color")]
public Color HeaderColor1
{
get { return headerColor1; }
set
{
headerColor1 = value;
Refresh();
}
}
[Category("CollapsiblePanel")]
[Description("Header Gradient Second Color")]
public Color HeaderColor2
{
get { return headerColor2; }
set
{
headerColor2 = value;
Refresh();
}
}
[Category("CollapsiblePanel")]
[Description("Header Gradient Mode")]
public LinearGradientMode HeaderGradient
{
get { return headerGradientMode; }
set
{
headerGradientMode = value;
Refresh();
}
}
[Category("CollapsiblePanel")]
[Description("Panel Header Height")]
public int HeaderHeight
{
get { return pnlHeader.Height; }
set
{
pnlHeader.Height = value;
Refresh();
}
}