| DesignMode 谁使用成功过?始终是false...头真大 |
作者:【孟子E章】 发布日期:2008-10-28 00:00:00
|
【解答】:
不要再构造器里面进行判断,构造器里可以使用下面的方法 System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv"
判断
the DesignMode property should not be checked from within the constructor or from any code that the constructor calls. A constructor is called before a control is sited, and it's the site that determines whether or not a control is in design mode. DesignMode will also be false in the constructor.
|
原文地址:http://dotnet.aspx.cc/article/5b9ad151-4c46-4af8-a9d3-97ff8829eff0/print.aspx
© 版权所有 【孟宪会之精彩世界】TM 2012