本文整理汇总了C#中System.Windows.Controls.WebBrowser.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# WebBrowser.SetValue方法的具体用法?C# WebBrowser.SetValue怎么用?C# WebBrowser.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.WebBrowser
的用法示例。
在下文中一共展示了WebBrowser.SetValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetScriptErrorsSuppressed
public static void SetScriptErrorsSuppressed(WebBrowser browser, bool value)
{
browser.SetValue(ScriptErrorsSuppressedProperty, value);
}
示例2: SetHtml
public static void SetHtml(WebBrowser d, string value)
{
d.SetValue(HtmlProperty, value);
}
示例3: TryHookWebBrowser
private static bool TryHookWebBrowser(WebBrowser webBrowser)
{
if (GetSuppressEraseBackground(webBrowser))
{
// Try to find the IE window several layers within the WebBrowser.
IntPtr hwndIEWindow = GetIEWindow(webBrowser);
if (hwndIEWindow != IntPtr.Zero)
{
// Hook the window messages so we can intercept the
// WM_ERASEBKGND message.
IEWindowHook hook = new IEWindowHook(new HWND(hwndIEWindow));
// Keep our hook alive.
webBrowser.SetValue(SuppressEraseBackgroundWindowHookProperty, hook);
return true;
}
}
return false;
}
示例4: SetUrl
public static void SetUrl(WebBrowser d, string value) => d.SetValue(UrlProperty, value);
示例5: SetSuppressScriptErrors
/// <summary>
/// Attached property setter for the SuppressScriptErrors property.
/// </summary>
public static void SetSuppressScriptErrors(WebBrowser webBrowser, bool value)
{
webBrowser.SetValue(SuppressScriptErrorsProperty, value);
}
示例6: generateRightCanvas
/// <summary>
/// Generate right page
/// </summary>
/// <param name="pageNumber"></param>
/// <returns>canvas, right canvas to renderBook()</returns>
private Canvas generateRightCanvas(int pageNumber)
{
SolidColorBrush whiteBrush = new SolidColorBrush();
whiteBrush.Color = Colors.White;
Canvas canvas = new Canvas();
canvas.Width = 520;
canvas.Height = 720;
canvas.Background = whiteBrush;
canvas.Margin = new Thickness(520, 0, 0, 0);
// Amu
WebBrowser wbRightPage = new WebBrowser();
// If there is odd number of pages last page in right will be empty (in future it will be filled with next chapter's first page)
if (!(parser.pageCount < (pageNumber + 1)))
{
wbRightPage.NavigateToString(splittedPages[pageNumber]);
}
wbRightPage.Width = 490;
wbRightPage.Height = 700;
wbRightPage.Margin = new Thickness(0, 8, 0, 0);
wbRightPage.Foreground = new SolidColorBrush(Colors.Magenta);
// set the padding area to top and to left
wbRightPage.SetValue(Canvas.LeftProperty, 20.00);
wbRightPage.SetValue(Canvas.TopProperty, 50.00);
canvas.Children.Add(wbRightPage);
Rectangle rectangle = new Rectangle();
rectangle.Width = 32;
rectangle.Height = 720;
rectangle.Fill = this.Resources["RightShadow"] as LinearGradientBrush;
rectangle.Margin = new Thickness(0, 0, 0, 0);
canvas.Children.Add(rectangle);
return canvas;
}
示例7: generateLeftCanvas
/// <summary>
/// Generate left page
/// </summary>
/// <param name="pageNumber"></param>
/// <returns>canvas, left canvas to renderBook()</returns>
private Canvas generateLeftCanvas(int pageNumber)
{
SolidColorBrush whiteBrush = new SolidColorBrush();
whiteBrush.Color = Colors.White;
Canvas canvas = new Canvas();
canvas.Width = 520;
canvas.Height = 720;
canvas.Background = whiteBrush;
canvas.Margin = new Thickness(0, 0, 0, 0);
WebBrowser wbLeftPage = new WebBrowser();
wbLeftPage.NavigateToString(splittedPages[pageNumber]);
wbLeftPage.Width = 490;
wbLeftPage.Height = 700;
wbLeftPage.Margin = new Thickness(8, 8, 0, 0);
wbLeftPage.Foreground = new SolidColorBrush(Colors.Magenta);
// set the padding area to top and to left
wbLeftPage.SetValue(Canvas.LeftProperty, 20.00);
wbLeftPage.SetValue(Canvas.TopProperty, 50.00);
canvas.Children.Add(wbLeftPage);
Rectangle rectangle = new Rectangle();
rectangle.Width = 32;
rectangle.Height = 720;
rectangle.Fill = this.Resources["LeftShadow"] as LinearGradientBrush;
rectangle.Margin = new Thickness(490, 0, 0, 0);
canvas.Children.Add(rectangle);
return canvas;
}
示例8: SetWebContent
public static void SetWebContent(WebBrowser web_browser, Stream value) { web_browser.SetValue(WebContentProperty, value); }
示例9: SetBindableSource
/// <summary>
/// Sets the bind-able version of the source property.
/// </summary>
/// <param name="webBrowser">The web browser.</param>
/// <param name="value">The source value.</param>
public static void SetBindableSource(WebBrowser webBrowser, string value)
{
webBrowser.SetValue(BindableSourceProperty, value);
}