您的位置:首页 > 产品设计 > UI/UE

Extract UserControls from IssueVision Part I -- PaneCaption

2004-11-09 17:23 513 查看
IssueVision is the code example for Smart Client at DevDays 2004. You can get more infomation from DevDays 2004 video .

There are several XP style UserControls contained in this solution. Now, let's extract them for our own projects.

PaneCaption

private bool m_antiAlias = false; 

  [CategoryAttribute("Appearance")]
  [DescriptionAttribute("If should draw the text as antialiased.")]
  [DefaultValueAttribute(true)]

 

understood?


what? did not?


oh, my god. Let me explain.


“[DefaultValueAttribute(true)]” means the default value of this property(AntiAlias) is “true“; “private bool m_antiAlias = false;“ 
means it sets the property variant into “false“ when you put the control on form(design time).


As we known, in visual studio, it will modify the InitializeComponent() automatically when you changed a value in property toolbox. Now, the initialized value is “false” not the default value “true”. Obviously, the IDE think it's the default value! So, it write the opposite code.


[code]Thus, modify “private bool m_antiAlias = false;
”into “private bool m_antiAlias = true;”then you will enable “AntiAlias” ability.


Moreover, AllowActive has this problem too. I believe you can solve it yourself.


Enjoy it. ;)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: