- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
当复杂的 WinForms 应用中有多个层时,Windows 10 Creators 会崩溃。这可以很容易地用下面的代码重现。当悬停或单击 >= 40 层顶部的 UI 时,系统会崩溃并出现 BSOD。它应该会遇到异常。
有人知道避免完全崩溃的调整吗?
代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PanelLayers
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int maxCount = 45;
int count = 0;
this.CreateLayers(this, maxCount, ref count);
}
private void CreateLayers(Control BaseControl, int MaxCount, ref int Count)
{
if(Count == MaxCount)
{
Button btn = new Button();
btn.Text = "Click me";
btn.Location = new Point(8, 8);
btn.Click += btn_Click;
BaseControl.Controls.Add(btn);
}
else
{
Count++;
Panel pnl = new Panel();
pnl.Dock = DockStyle.Fill;
try
{
BaseControl.Controls.Add(pnl);
this.CreateLayers(pnl, MaxCount, ref Count);
}
catch(Exception ex)
{
MessageBox.Show(String.Format("Exception hit at count {0}{1}{2}{1}{3}", Count, Environment.NewLine, ex.Message, ex.StackTrace));
}
}
}
void btn_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello Creators Update!");
this.Close();
}
}
}
最佳答案
它看起来可能与 Windows 8/Windows Server 2012 上发现的另一个问题(相同?)有关。参见 here .
更新
Microsoft 已提供修复:https://support.microsoft.com/en-us/help/4022716/windows-10-update-kb4022716
这是它的描述:
"Addressed issue (Error 0x7F) with Windows Forms (WinForms) that causes the system to crash after upgrading to the Creators Update."
关于Windows 10 Creators Updates 破坏了 WinForms 应用程序/蓝屏死机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43583651/
我刚刚开始尝试 Android 开发并希望使用 PhoneGap。 使用他们的入门指南 (http://phonegap.com/start#android) 我已经到了最后一步,即在 Android
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我们发现在特定条件下运行我们的应用程序会导致 Windows 蓝屏。经过一些调查后,我们能够使用 Winsock2 API 将场景缩小到大约 50 行 C 代码的示例。 MS 请求删除的示例-详细信息
大家好:这对我来说仍然是个谜。在我按下“查找我”按钮后,我的应用加载蓝屏(海洋),其中包含以下内容: -(IBAction)findMe { self.mapView.showsUserLocat
因此,我正在 OpenGL 中构建一个默认上下文(没有扩展),出于某种原因,我的窗口一打开,我就出现“意外的内核模式陷阱”蓝屏死机 现在,这是非常默认的。因为我刚刚使用了启动 VS 2015 Comm
我是一名优秀的程序员,十分优秀!