启动画面错误消息 [英] Splash screen error message

查看:98
本文介绍了启动画面错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试使用启动屏幕构建选项以最简单的方式(至少在当前时间)启动启动屏幕.但是我不断收到错误消息:

调用线程必须是STA,因为许多UI组件都需要此"

我绝对不知道这意味着什么!如果有人能启发我,将不胜感激.

Thanks

Hi, I am trying to implment a splash screen in the easiest way possible(at the minute) using the splash screen build option. However I keep getting the error:

"The calling thread must be STA, because many UI components require this"

I have absolutly no idea what this means! If someone could enlighten me it would be appreciated.

Thanks

推荐答案

这意味着该应用程序的线程模型与您正在使用的组件不兼容.最简单的解决方法是创建您自己的表单以显示启动画面,或编写一个Win32应用程序来显示启动画面并启动您的主应用程序.我们使用后者,因为b/c WPF的启动速度很慢,并且启动需要一段时间才能显示,否则.
It means that the threading model of the app is incompatible with the component you''re using. The easiest fix is to create your own form to show the splash, or write a Win32 app that shows it and launches your main app. We do the latter, b/c WPF is slow to start and the splash took a while to appear, otherwise.


如果从主线程调用启动屏幕,则需要对其进行标记为STAThread.
此处详细了解 [
If the splash screen is called from the main thread you need to mark it as STAThread.
Read more about STA here[^].


这篇关于启动画面错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆