我在定义 BorderBrush 时遇到一些基本的编译问题
我在定义 BorderBrush 时遇到一些基本的编译问题。
http://msdn.microsoft.com/en -us/library/system.windows.controls.border.borderbrush.aspx 指出您像这样定义了 borderbrush:
myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
但是在我的代码中,当我尝试时,
border1.BorderBrush = Brushes.SlateBlue;
我得到 错误 1 当前上下文中不存在名称“Brushes”
我已经包含了命名空间 系统.Windows.Controls
作为文件顶部的“using”语句 以及对该项目的参考。 我缺少什么?
I am having some basic compile issues defining a BorderBrush.
http://msdn.microsoft.com/en-us/library/system.windows.controls.border.borderbrush.aspx
states that you define a borderbrush like this:
myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
but in my code, when I try
border1.BorderBrush = Brushes.SlateBlue;
I getError 1 The name 'Brushes' does not exist in the current context
and I have included the namespaceSystem.Windows.Controls
as a "using" statement at the top of the file
as well as a Reference to the project.
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
Silverlight
没有Brushes
类try
Silverlight
doesn't have aBrushes
classBrushes在System.Drawing里面...我默认有它,也许你把它拿出来了???
Brushes is inside System.Drawing... I have it by default, maybe you took it out???