日期:2014-05-20  浏览次数:21108 次

怎样生成一个光标Cursor文件?最好直接生成在内存中就可以调用的
怎样生成一个光标Cursor文件?最好直接生成在内存中就可以调用的。

画线,想要求光标随选择的线宽不同而改变光标大小。

------解决方案--------------------
.net的新建文件中就要呀,直接添加就可以了。
------解决方案--------------------
例:
public sealed class TestCursor{
static Cursor columnWidthCursor;
public TestCursor(){}
static Cursor GetCursor(string cursorName)
{
Cursor cursor1 = null;
try
{
Type type1 = typeof(TestCursors);
Stream stream1 = type1.Module.Assembly.GetManifestResourceStream(cursorName);
cursor1 = new Cursor(stream1);
}
catch (Exception exception1)
{
MessageBox.Show(exception1.Message);
throw exception1;
}
return cursor1;
}
}
public static Cursor ExcelCellCursor
{
get
{
if (columnWidthCursor== null)
{
columnWidthCursor= GetCursor( "WIDTH.CUR ");
}
return columnWidthCursor;
}
set
{
columnWidthCursor= value;
}}
//还可以定义其他的,自己可以添加了试一下。
}