)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get access to an HTML element in WinForms HTMLUIControl?

Platform: WinForms |
Control: HTMLUIControl |
Published Date: April 30, 2011 |
Last Revised Date: January 3, 2020

HTML elements

The HTML elements are accessed in HTMLUI for developing advanced UIs. The HTML elements are collected in a collection class. The Hashtable, when used as a collection class, stores the HTML elements with a key, specific for each element.

These elements are then assigned to the code variables. The code variables are the objects of the classes, that are responsible for the functionality of the tag elements. These classes contain the definitions for the properties, methods and events for the tag elements. These variables will be used in accessing the HTML elements inside the code.

The following HTML document shows an input tag textbox element with an id as a key for accessing it in the Hashtable.

C#

//declaring the code variable of the tag element
//INPUTElementImpl is responsible for the INPUT tag in HTMLUI
INPUTElementImpl text;
//Collection class accessing the HTML document with the userID as the key
Hashtable htmlelements = this.htmluiControl1.Document.GetElementsByUserIdHash();
//Code variable assigned to the html element with the help of the element's id as the key
this.text = htmlelements["txt"] as INPUTElementImpl;
//usage of the code variable inside the project
this.text.UserControl.CustomControl.Text = "HTML Elements in HTMLUI";

 

VB

'declaring the code variable of the tag element
'INPUTElementImpl is responsible for the INPUT tag in HTMLUI
Private text As INPUTElementImpl
'Collection class accessing the HTML document with the userID as the key
Private htmlelements As Hashtable = Me.htmluiControl1.Document.GetElementsByUserIdHash()
'Code variable assigned to the html element with the help of the element's id as the key
Me.text = CType(IIf(TypeOf htmlelements("txt") Is INPUTElementImpl, htmlelements("txt"), Nothing), INPUTElementImpl)
'usage of the code variable inside the project
Me.text.UserControl.CustomControl.Text = "HTML Elements in HTMLUI"

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon