鼠标移到datalist某一行时改变该行的背景色
解决方案 »
- DrawString与textbox的字距行距不同,有没有办法改为相同?
- C#中图像的平移问题
- Datable生成XML中文显示乱码
- 怎樣把這段代碼改為VB.NET
- 怎样能计算有一段程序运行了多长时间,程序运行完弹出messagebox即可,显示多少秒或几分几秒
- 请问:如何在datagrid中加入combobox,是在winform中,不是webform
- 请教一个关于文件写入的问题
- 关于C#的动态数组
- 请问如何用C#在WindowsForm 中添加类似 webform中的表格的控件,最好是。net自己带的控件;另外说一下如何在datagrid中再加入如ComboBox,
- 终于有颗小星星了,呵呵,散分啦....帮过我的.我帮过的.所有CSDN网友都有份啊
- 求教关于C#中setwindowshookex
- 运行以下代码时,出现“方法必须具有返回类型”的错误提示
if (TbRow != null)
{
for (var i=0;i<TbRow.rows.length ;i++ )
{
if (TbRow.rows[i].rowIndex%2==1)
{
TbRow.rows[i].style.background="#ffffff";
}
else
{
TbRow.rows[i].style.background="url(img/sepbg-2.gif) repeat-x left bottom";
}
}
}</script>
onload= function ()
{
var a=document.getElementById("Gvstockodd");
var len=a.rows.length;
a.style.backgroundColor="#bfccff";
for(var i=1;i<len;i++)
{
if(i%2)
{
a.rows[i].style.backgroundColor="#f4d2ff";
a.rows[i].onmouseout=function()
{
this.style.backgroundColor="#f4d2ff";
}
}
else
{
a.rows[i].onmouseout=function()
{
this.style.backgroundColor="";
}
}
a.rows[i].onmouseover=function()
{
this.style.backgroundColor="#2ba2ff";
}
}
}
if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
{
i = i + 1;
if (i > 10&&i <= 20)
{
e.Item.BackColor = System.Drawing.Color.FromName("#ECF4DF");
}
if (i >= 20)
{
i = 0;
}
}
e.Item.Attributes.Add("onMouseOver", "javascript:bgcolor=this.style.backgroundColor;this.style.backgroundColor='#ffd700';");
e.Item.Add("onmouseout", "javascript:this.style.backgroundColor=bgcolor;");
还可以用Attributee.Item[i].Attributes["onmouseover"] = "this.style.backgroundColor='#CCFFFF'"; //鼠标悬浮颜色
e.Item[i].Attributes["onmouseout"] = "this.style.backgroundColor='White'"; //鼠标离开颜色