public partial class Form1 : Form
{
//自定义的变量,用来记录当前选择的图形
Style style = Style.Line;//Style这里提示错误,
……
}编译背景:
我是在以前的书上看到的一个例子
是C#2.0的
vs2010错误提示:
错误1 未能找到类型或命名空间名称“Style”(是否缺少 using 指令或程序集引用?)已有命名空间:using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows ;
{
//自定义的变量,用来记录当前选择的图形
Style style = Style.Line;//Style这里提示错误,
……
}编译背景:
我是在以前的书上看到的一个例子
是C#2.0的
vs2010错误提示:
错误1 未能找到类型或命名空间名称“Style”(是否缺少 using 指令或程序集引用?)已有命名空间:using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows ;
解决方案 »
- 在局域网中怎样获得windows域服务器中用户ID和密码
- C#导出excel问题
- 字符串转数组,望赐教
- 求助,C#调用包装后的C++DLL代码,执行速度极慢
- .net的困惑
- 高分紧急求救:为什么url重写(urlrewrite)在本地测试可以,放上服务器就不行了?显示找不到文件。本地是2000 系统,网上是2003系统!
- DataGridView中,行中有单元格处于编辑状态下时,如何删除行?
- c#.net写好的程序,如何将它编译成.DLL文件,使它可以在服务器端运行?
- Console.WriteLine如何输出彩色字符?
- 问一个关于泛型List<T> 的问题
- ASP(C#)菜鸟求图书推荐~
- 怎么设置启动项
从LZ的注释来看,Style 我估计是自定义的一个枚举,像这样的
enum Style {
Line,Circle,Rectangle };
style.BackColor = Color.Blue;
this.Header.StyleSheet.CreateStyleRule(style, null, "body");设置样式的。
s.BackColor = Color.Red;
在winform中,表示在类型的不同实例之间共享属性、资源和事件处理程序。
在命名空间System.Windows下
MSDN:http://msdn.microsoft.com/zh-cn/library/system.windows.style.aspx
在webform中,表示 Web 服务器控件的样式。
在命名空间System.Web.UI.WebControls下
MSDN:http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.style.aspx