做类似QQ图象跳动功能
我想到两种方法
1、动态更换treeview节点上的图象
2、更换treeview节点上图象的坐标目前我想采用第2种
但不知道怎么做
请高人帮忙
我想到两种方法
1、动态更换treeview节点上的图象
2、更换treeview节点上图象的坐标目前我想采用第2种
但不知道怎么做
请高人帮忙
解决方案 »
- vs2008 winform输入框输入中文后保存到数据库中变乱码问题
- 如何在打包程序中实现客户填写信息
- 引发类型为“System.ExecutionEngineException”的异常。
- 水晶报表显示表头的问题
- 如何让vs2008下开发的程序在windows2000下运行(在项目属性中已经降成了2.0FrameWork)
- 关于asp.net应用TTS(Text-to-Speech)的问题
- C# 中类似VB中 With end With 的语句是什么?
- 请问高手如何在一个frame中控制这个页面?
- gridview刷新问题
- 求教: 在2003上安装完VS.NET后,不能建WEB应用程
- 求SQL语句
- C#中有类似于C++中的容器吗?还有动态数组怎么定义?
/// <summary>
/// 偏移的序号
/// </summary>
private int flashIndex = -1;
/// <summary>
/// 偏移的坐标集
/// </summary>
private Point[] pointFlashs = new Point[] {
new Point(0, +1), new Point(0, -1),
new Point(+1, 0), new Point(-1, 0) };
private void timer1_Tick(object sender, EventArgs e)
{
TreeNode vTreeNode = treeView1.SelectedNode;
if (vTreeNode == null) // 无节点处理
{
if (flashIndex >= 0)
{
treeView1.Refresh();
flashIndex = -1;
}
return;
}
if (!vTreeNode.IsVisible) return; // 不可见
if (flashIndex < 0) flashIndex = 0;
Graphics vGraphics = treeView1.CreateGraphics();
Rectangle vRectangle = new Rectangle(
vTreeNode.Bounds.Left - imageList1.ImageSize.Width - 3,
vTreeNode.Bounds.Top, imageList1.ImageSize.Width, imageList1.ImageSize.Height
);
vGraphics.FillRectangle(new SolidBrush(treeView1.BackColor), vRectangle);
int vImageIndex = vTreeNode.ImageIndex;
if (vImageIndex < 0) vImageIndex = 0;
imageList1.Draw(vGraphics,
vRectangle.Left + pointFlashs[flashIndex].X,
vRectangle.Top + pointFlashs[flashIndex].Y, vImageIndex);
vGraphics.Dispose();
flashIndex = (flashIndex + 1) % pointFlashs.Length;
}
想不到有人回贴了
我周一再来试
zswang 的方法
谢谢你