为什么我得到这个异常..“调用线程必须是STA,因为许多UI组件需要这个”...在KinectTileButtonBase上 [英] Why am I getting this exception.."The calling thread must be STA, because many UI components require this"...on KinectTileButtonBase

查看:51
本文介绍了为什么我得到这个异常..“调用线程必须是STA,因为许多UI组件需要这个”...在KinectTileButtonBase上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



推荐答案

您是否正在创建Windows窗体应用程序或WPF应用程序?

Are you creating a Windows Form application or WPF app?

对于perf或WPF特定问题,您可能需要参考WPF UI并呈现线程文档/论坛。您无法在后台线程上创建UI元素。您必须将按钮的创建分配给UI线程。

As for the perf or WPF specific questions, you may need to refer to WPF UI and render threading documentation/forums. You cannot create UI elements on background threads. You will have to dispatch the creation of the buttons to the UI thread.


这篇关于为什么我得到这个异常..“调用线程必须是STA,因为许多UI组件需要这个”...在KinectTileButtonBase上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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