我有一个windows应用程序,它在应用程序运行时工作,但是在设计视图中,OnLoad事件中的代码由于各种原因而崩溃。有没有办法做到这一点:
private void WindowsForm_OnLoad(object sender, EventArgs e)
{
if (IsDesignView())
{
// some code that breaks in design view but works normally
}
为了确保图像加载在页面上,然后继续到下一个状态,我们使用了前面提到的onload方法。
image = new Image();
image.onload = function(){
// go to the next state
};
image.src = image_url;
问题是,对于大小为零的图像,事件不会触发,因此页面处于暂停模式,不会进入下一个状态。
对于大小为零的图像,处理不触发onload函数的最佳方法是什么?
相关问题:
1-