SetStyle 函数怎么用

zhangwenqian 2009-06-05 09:16:54
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint,
true);

函数的参数为什么要用"|", 第一个参数是什么意思?
...全文
123 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
csrwgs 2009-06-05
  • 打赏
  • 举报
回复
myControl.SetStyle(UserPaint Or AllPaintingInWmPaint Or DoubleBuffer, True)

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.



意思是这个ControlStyles是一个Enumeration ,他可以传递一个组合参数给SetStyle。

or 或者 '|'表示组合

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧