HtmlElement::CanHaveChildren Property

 

Gets a value indicating whether this element can have child elements.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property bool CanHaveChildren {
	bool get();
}

Property Value

Type: System::Boolean

true if element can have child elements; otherwise, false.

Some elements, such as IMG and SCRIPT, cannot have any children. Use this property before you call AppendChild or InsertAdjacentElement on an arbitrary element.

The following code example handles the Click event on HtmlDocument. If an element was not previous selected using a mouse click, the code assigns the element to a private class variable named MoveElement. If an element was selected, the code attempts to append it to the element that was just clicked. This code example requires that your application hosts a WebBrowser control named WebBrowser1, and that you have already added an event handler for the Click event on HtmlDocument.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: