我有3.5MDI WinForms申请。
我确定了一种儿童形式:Icon
财产,icon在形式上左上角正确显示。 然后,我最大限度地扩大儿童的形式,而icon仍然是科索沃。
在儿童表格中,我打开了另一个儿童窗口,自动得到最大化。 这种形式的icon不是Icon
上的财产,而是 default.NET icon(即蓝、红和黄皮)。 然而,如果我
是否有任何人工作,或知道为什么会发生?
我有3.5MDI WinForms申请。
我确定了一种儿童形式:Icon
财产,icon在形式上左上角正确显示。 然后,我最大限度地扩大儿童的形式,而icon仍然是科索沃。
在儿童表格中,我打开了另一个儿童窗口,自动得到最大化。 这种形式的icon不是Icon
上的财产,而是 default.NET icon(即蓝、红和黄皮)。 然而,如果我
是否有任何人工作,或知道为什么会发生?
我找到了解决办法......
下一步工作是重新确定儿童装货单如下:
private void StatsForm_Load(object sender, EventArgs e)
{
//bug that means you have to set the desired icon again otherwise it reverts to default when child form is maximised
Icon = new System.Drawing.Icon("research.ico");
}
这确实意味着,你必须首先在您的VS项目/溶解中增加所涉的icon文档,并将其归入“Copy Always”,以便在你的解决方案建立时加以复制。
HTH Calanus
略微修改Calanus的解决办法:
private void MdiBase_Load(object sender, EventArgs e)
{
// Fixes bug where loading form maximised in MDI window shows incorrect icon.
this.Icon = Icon.Clone() as Icon;
}
这使你能够在设计时间确定icon(如你对其他形式所做的解释),不需要任何硬编码文档或资源。
private void frmChild_Shown(object sender, EventArgs e)
{
// Work-around for maximized BUG
this.Icon = this.MdiParent.Icon;
this.WindowState = FormWindowState.Normal;
this.WindowState = FormWindowState.Maximized;
}
我发现,这也将解决这个问题。
myForm.WindowState = FormWindowState.Normal;
myForm.Show();
myForm.WindowState = FormWindowState.Maximized;
My solution: Leave the MdiChild "ShowIcon" property set to true, assign a 1x1 transparent icon. Problem solved.
form.WindowState = FormWindowState.Normal
form.Show()
form.WindowState = FormWindowState.Maximized
form.Show()
解决我的问题!
将这作为教育、青年和体育部儿童教育模式中第1行的内容添加给我:
this.Icon = new Icon(this.Icon, this.Icon.Size);
我发现解决这一问题的最佳工作是:here。
aNewForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog
AddHandler aNewForm.SizeChanged, AddressOf Form_SizeChanged
aNewForm.Show()
aNewForm.WindowState = FormWindowState.Maximized
RemoveHandler aNewForm.SizeChanged, AddressOf Form_SizeChanged
提 交 人
Protected Sub Form_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)
If WindowState = FormWindowState.Maximized Then
If FormBorderStyle <> FormBorderStyle.Sizable Then FormBorderStyle = FormBorderStyle.Sizable
End If
End Sub