第一步:
重写页面的 Render 方法,并为 Corner 添加一个 onmousedown 的客户端事件
- C#
-
protected override void Render(HtmlTextWriter writer) { WebControl corner = this.FpSpread1.FindControl("corner") as WebControl; corner.Attributes.Add("onmousedown", "return CornerClick()"); base.Render(writer); } 复制代码
VB.NET
Protected Overrides Sub Render(writer As HtmlTextWriter) Dim corner As WebControl = TryCast(Me.FpSpread1.FindControl("corner"), WebControl) corner.Attributes.Add("onmousedown", "return CornerClick()") MyBase.Render(writer) End Sub 复制代码第二步:
添加客户端 JS 代码
<script type="text/javascript"> function CornerClick() { event.cancelBubble = true; event.returnValue = false; return false; } </script> 复制代码