# WebBrowserExtensions

Namespace: **Wisej.Web.Markup**

Assembly: **Wisej.Framework** (4.0.0.0)

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [Timer](/api/wisej.web/other-components/wisej.web.timer.md) class.

{% tabs %}
{% tab title="C#" %}

```csharp
public class WebBrowserExtensions
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class WebBrowserExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) BorderStyle\<TWebBrowser>(webBrowser, borderStyle)

Sets the BorderStyle property of the specified [WebBrowser](/api/wisej.web/content/webbrowser.md).

| Parameter       | Type                                                                                     | Description                                                                                        |
| --------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **TWebBrowser** |                                                                                          | The type of the web browser, must inherit from [WebBrowser](/api/wisej.web/content/webbrowser.md). |
| **webBrowser**  | [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md) | The web browser for which to set the BorderStyle property.                                         |
| **borderStyle** | [BorderStyle](/api/wisej.web/enumerations/wisej.web.borderstyle.md)                      | The [BorderStyle](#borderstyle``1) to set for the web browser.                                     |

**Returns:** [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md). The modified web browser with the updated BorderStyle property.

This method allows you to specify the border style for the web browser.

```csharp

myWebBrowser.BorderStyle(BorderStyle.FixedSingle);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) OnDocumentCompleted\<TWebBrowser>(webBrowser, action)

Attaches an event handler for the DocumentCompleted event of the specified [WebBrowser](/api/wisej.web/content/webbrowser.md).

| Parameter       | Type                                                                                                                | Description                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **TWebBrowser** |                                                                                                                     | The type of the web browser, must inherit from [WebBrowser](/api/wisej.web/content/webbrowser.md). |
| **webBrowser**  | [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md)                            | The web browser to attach the event handler to.                                                    |
| **action**      | [Action\<TWebBrowser, WebBrowserDocumentCompletedEventArgs>](https://docs.microsoft.com/dotnet/api/system.action-2) | An action to execute when the document has completed loading.                                      |

**Returns:** [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md). The modified web browser with the attached DocumentCompleted event handler.

This method allows you to execute a custom action whenever the document in the web browser completes loading.

```csharp

myWebBrowser.OnDocumentCompleted((wb, args) =>
{
AlertBox.Show("Document loaded!");
});

```

### ![](/files/lIX317sDtMTZJBi9oSIx) ScrollBarsEnabled\<TWebBrowser>(webBrowser, scrollBarsEnabled)

Sets the ScrollBarsEnabled property of the specified [WebBrowser](/api/wisej.web/content/webbrowser.md).

| Parameter             | Type                                                                                     | Description                                                                                        |
| --------------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **TWebBrowser**       |                                                                                          | The type of the web browser, must inherit from [WebBrowser](/api/wisej.web/content/webbrowser.md). |
| **webBrowser**        | [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md) | The web browser for which to set the ScrollBarsEnabled property.                                   |
| **scrollBarsEnabled** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                          | A boolean indicating whether scroll bars are enabled.                                              |

**Returns:** [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md). The modified web browser with the updated ScrollBarsEnabled property.

This method allows you to enable or disable scroll bars in the web browser.

```csharp

myWebBrowser.ScrollBarsEnabled(true);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Url\<TWebBrowser>(webBrowser, url)

Sets the Url property of the specified [WebBrowser](/api/wisej.web/content/webbrowser.md) using a string.

| Parameter       | Type                                                                                     | Description                                                                                        |
| --------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **TWebBrowser** |                                                                                          | The type of the web browser, must inherit from [WebBrowser](/api/wisej.web/content/webbrowser.md). |
| **webBrowser**  | [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md) | The web browser for which to set the Url property.                                                 |
| **url**         | [String](https://docs.microsoft.com/dotnet/api/system.string)                            | The URL to navigate to, as a string.                                                               |

**Returns:** [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md). The modified web browser with the updated Url property.

This method allows you to navigate the web browser to a specified URL using a string.

```csharp

myWebBrowser.Url("http://example.com");

```

### ![](/files/lIX317sDtMTZJBi9oSIx) Url\<TWebBrowser>(webBrowser, url)

Sets the Url property of the specified [WebBrowser](/api/wisej.web/content/webbrowser.md) using a [Uri](https://docs.microsoft.com/dotnet/api/system.uri).

| Parameter       | Type                                                                                     | Description                                                                                        |
| --------------- | ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **TWebBrowser** |                                                                                          | The type of the web browser, must inherit from [WebBrowser](/api/wisej.web/content/webbrowser.md). |
| **webBrowser**  | [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md) | The web browser for which to set the Url property.                                                 |
| **url**         | [Uri](https://docs.microsoft.com/dotnet/api/system.uri)                                  | The URL to navigate to, as a [Uri](https://docs.microsoft.com/dotnet/api/system.uri).              |

**Returns:** [TWebBrowser](/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md). The modified web browser with the updated Url property.

This method allows you to navigate the web browser to a specified URL using a [Uri](https://docs.microsoft.com/dotnet/api/system.uri).

```csharp

myWebBrowser.Url(new Uri("http://example.com"));

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web.markup/extensions/wisej.web.markup.webbrowserextensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
