组件初始化 - 运行时与设计时间 [英] Component Initialization - Runtime vs. Designtime

查看:153
本文介绍了组件初始化 - 运行时与设计时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一系列可视化复合组件,它们使用类似/常用的连接方法,它们在内部表格等上启动。



我自动化一些在运行时自动连接的连接东西。在组件级别,如何判断当前状态是运行时还是设计时间?如何判断?

解决方案

如果组件的 ComponentState 属性中存在 csDesigning 标志:



如果csDesigning在ComponentState然后
//设计时间
else
//不设计时间


I have a series of visual compound components that I'm building, which use similar / common "connect" methods, which fire up there internal tables, etc.

I am automating some of the connection stuff to connect automatically at runtime. How do I tell, at the component level, if the current state is runtime or designtime?

解决方案

I think you want to check if the csDesigning flag is present in the component's ComponentState property:

if csDesigning in ComponentState then
  // designtime
else
  // not designtime

这篇关于组件初始化 - 运行时与设计时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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