【发布时间】:2013-04-25 05:48:20
【问题描述】:
这是我的自定义WebBrowser control。
using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
public class RunescapeClient : WebBrowser
{
private const string RUNESCAPE_CLIENT_URL = "http://oldschool33.runescape.com/j1";
public RunescapeClient()
{
ScrollBarsEnabled = false;
ScriptErrorsSuppressed = true;
IsWebBrowserContextMenuEnabled = false;
AllowWebBrowserDrop = false;
Navigate(RUNESCAPE_CLIENT_URL);
}
protected override void OnDocumentCompleted(WebBrowserDocumentCompletedEventArgs e)
{
if (Document != null && ValidClientUrl(e.Url.ToString()))
{
HtmlElement tableElement = Document.GetElementsByTagName("table")[1];
tableElement.InnerText = string.Empty;
}
}
private static bool ValidClientUrl(string url)
{
return Regex.IsMatch(url, @"http://oldschool\d{1,2}.runescape.com/j1");
}
}
如何将这个control 的cursor 更改为我的embedded .ico。我用谷歌搜索了custom controls,找不到任何东西。
谢谢。
【问题讨论】:
-
你的问题是改变ICON,而不是(鼠标)-CURSOR?
-
如何将默认光标替换为资源中的自定义 .ICO 文件,因为 WebBrowser 控件只有默认图标可用。
标签: c# .net winforms cursor browser