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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Formatting Custom Controls

Thread ID:

Created:

Updated:

Platform:

Replies:

60101 Apr 27,2007 09:18 AM UTC May 1,2007 10:11 PM UTC Windows Forms 3
loading
Tags: HTMLUIControl
Dominic Messenger
Asked On April 27, 2007 09:18 AM UTC

I want to create some custom controls, that can be formatted using attributes and CSS.

How do I go about this ? Do I need to derive from a custom control base, or can I implement various interfaces that the HTMLUIControl will populate with the HTML Format?

I have experimented with implementing IHTMLFormat on my control but that doesn't seem to work.

Any advice appreciated.

Ramu [Syncfusion]
Replied On April 27, 2007 05:41 PM UTC

Hi Dominic,

Please have a look at the shipped sample in [[Installed Drive]:\Program Files\Syncfusion\Essential Studio\4.4.0.51\Windows\HTMLUI.Windows\Samples\Custom Controls] and let me know if you have any queries.

In the sample, the custom controls can be defined with the help of user defined tags in htm file and can be interfaced with the controls that are available on the form with the help of the the prerenderdocument event

* The prerenderdocument event occurs at the time when the HTML document is being loaded into the HTMLUI control but, the elements have not yet been positioned.

* The HTML elements are loaded into an hashtable with an equivalent id as their key. An equivalent Base class object, here BaseElement class, is defined in order to link the HTML elements that are stored in the hashtable with the help of the key that is associated with the element.

* The CustomControlBase is used to implement the base functionality of the Windows forms control on the HTML tag element.

I am working on implementing IHTMLFormat and will reply you in 24 hours.

Thank you for your interest in Syncfusion products.

Regards,
Ramu

Ramu [Syncfusion]
Replied On April 28, 2007 08:44 AM UTC

Hi Dominic,

Here is the code snippet that will help you to format the custom control.

This code can be added to a new command button of above said program to change the cursor type to hand symbol for datagrid.

C# Code:

HTMLFormat formatOrange = new HTMLFormat("FormatOrange");
formatOrange.Cursor = Cursors.Hand;

BaseElement dataGridElement1 = this.htmluiControl1.Document.GetElementByUserId("dataGrid1") as BaseElement;

//To set format to the custom control.
dataGridElement1.Format = (IHTMLFormat)formatOrange;


Please let me know if you have any queries.

Thanks,
Ramu

Dominic Messenger
Replied On May 1, 2007 10:11 PM UTC

Thanks for this.
I will take a look and let you know

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;