DEV Community

vblover programmer
vblover programmer

Posted on

Change Visibility of HTML Element at WinForms Application (VB .Net)

Hi there....

This is an Extension method to change the display of the HTML Element in
Windows Forms Applications:

References:
  1. Microsoft.mshtml
  2. System.Windows.Forms
Method:
 <Extension()>
    Public Sub SetVisibility(Element As HtmlElement, value As Boolean)
        With DirectCast(Element.DomElement, mshtml.IHTMLElement).style
            .display = If(value, "", "none")
        End With
    End Sub
Enter fullscreen mode Exit fullscreen mode
I hope will be useful....

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay