Represents a control that can host Html text.
public class HtmlBox: TextBox
The following table lists the members exposed by the HtmlBox object. Click a tab on the left to choose the type of member you want to view.
Methods
Method Description AppendText Appends text to the current text of the TextBoxBase. (Inherited from TextBoxBase) BringToFront Brings the control to the front of the z-order. (Inherited from Control) Clear Clears all text from the TextBoxBase. (Inherited from TextBoxBase) Contains Returns a value indicating whether the specified control is a child of the control. (Inherited from Control) CreateControl Forces the creation of the control, including the creation of the handle and any child controls. (Inherited from Control) CreateControlSkin Creates the skin for the Control. (Inherited from Control) CreateControlSkinInstance Overriden. Creates a ControlSkin instance for the TextBox. (Inherited from TextBox) CreateControlsInstance Creates a new instance of the control collection for the control. (Inherited from Control) CreateHandle Creates a handle for the control. (Inherited from Control) DeselectAll Deselects all the text in the TextBoxBase. (Inherited from TextBoxBase) DestroyHandle Destroys the handle associated with the control. (Inherited from Control) Dispose Overloaded. (Inherited from Component) Equals Overloaded. Compares two objects to determine if they are equal. (Inherited from Object) FindForm Returns the form that the control is on. (Inherited from Control) Focus Sets input focus to the control. (Inherited from Control) GetChildAtPoint Returns the child control that is located at the specified coordinates. (Inherited from Control) GetContainerControl Returns the next ContainerControl up the control's chain of parent controls. (Inherited from Control) GetHashCode Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object) GetLinkUrl Gets a string that represents an url of a new page. GetNextControl Returns the next control forward or back in the tab order of child controls. (Inherited from Control) GetStyle Returns the value of the specified control style bit for the control. (Inherited from Control) GetTopLevel Determines if the control is a top-level control. (Inherited from Control) GetType Gets the Type of the current instance. (Inherited from Object) Hide Hides the control from the user. (Inherited from Control) HtmlBox Initializes a new instance of HtmlBox. InitLayout Initializes the layout state of the control after it has been added to another container. (Inherited from Control) InternalMethod Inherited from Control. Invalidate Overloaded. Invalidates the control. This will cause a paint event to be sent later to the control. (Inherited from Control) InvokeGotFocus Raises the GotFocus event for the specified control. (Inherited from Control) InvokeLostFocus Raises the LostFocus event for the specified control. (Inherited from Control) InvokeOnClick Raises the Click event for the specified control. (Inherited from Control) InvokePaint Raises the Paint event for the specified control. (Inherited from Control) InvokePaintBackground Invoke the Control.OnPaintBackground method for the specified control. (Inherited from Control) IsInputChar Determines if a character is an input character that the control recognizes. (Inherited from Control) IsInputKey Overriden. Determines whether the specified key is a regular input key or a special key that requires preprocessing. (Inherited from TextBoxBase) IsMnemonic Determines if the specified character is the mnemonic character assigned to the control in the specified string. (Inherited from Control) OnAutoSizeChanged Raises the AutoSizeChanged event. (Inherited from TextBoxBase) OnBackColorChanged Raises the BackColorChanged event. (Inherited from Control) OnBorderStyleChanged Raises the BorderStyleChanged event. (Inherited from TextBoxBase) OnCausesValidationChanged Raises the CausesValidationChanged event. (Inherited from Control) OnClick Raises the Click event. (Inherited from Control) OnClientSizeChanged Inherited from Control. OnControlAdded Raises the ControlAdded event. (Inherited from Control) OnControlRemoved Raises the ControlRemoved event. (Inherited from Control) OnCreateControl Overriden. Raises the CreateControl event. (Inherited from TextBox) OnCursorChanged Raises the CursorChanged event. (Inherited from Control) OnDockChanged Raises the DockChanged event. (Inherited from Control) OnDoubleClick Raises the DoubleClick event. (Inherited from Control) OnEnabledChanged Overriden. Raises the EnabledChanged event. (Inherited from TextBoxBase) OnEnter Raises the Enter event. (Inherited from Control) OnFontChanged Overriden. Raises the FontChanged event. (Inherited from TextBox) OnForeColorChanged Overriden. Raises the ForeColorChanged event. (Inherited from TextBoxBase) OnGotFocus Raises the GotFocus event. (Inherited from Control) OnHandleCreated Overriden. Raises the HandleCreated event. (Inherited from TextBox) OnHandleDestroyed Raises the HandleDestroyed event. (Inherited from Control) OnKeyDown Raises the KeyDown event. (Inherited from Control) OnKeyPress Raises the KeyPress event. (Inherited from Control) OnKeyUp Raises the KeyUp event. (Inherited from Control) OnLayout Raises the Layout event. (Inherited from Control) OnLeave Raises the Leave event. (Inherited from Control) OnLinkClicked Raises the LinkClicked event. OnLocationChanged Raises the LocationChanged event. (Inherited from Control) OnLostFocus Raises the LostFocus event. (Inherited from Control) OnModifiedChanged Raises the ModifiedChanged event. (Inherited from TextBoxBase) OnMouseDown Raises the MouseDown event. (Inherited from Control) OnMouseEnter Overriden. Raises the MouseEnter event. (Inherited from TextBox) OnMouseLeave Overriden. Raises the MouseLeave event. (Inherited from TextBox) OnMouseMove Raises the MouseMove event. (Inherited from Control) OnMouseUp Raises the MouseUp event. (Inherited from Control) OnMouseWheel Raises the MouseWheel event. (Inherited from Control) OnMove Raises the Move event. (Inherited from Control) OnMultilineChanged Raises the MultilineChanged event. (Inherited from TextBoxBase) OnNCPaint Occurs when the non-client area of the control needs to be redrawn. (Inherited from Control) OnPaint Overriden. Raises the Paint event. (Inherited from TextBox) OnPaintBackground Paints the background of the control. (Inherited from Control) OnParentChanged Raises the ParentChanged event. (Inherited from Control) OnParentEnabledChanged Raises the EnabledChanged event when the Enabled property value of the control's container changes. (Inherited from Control) OnParentVisibleChanged Raises the VisibleChanged event when the Visible property value of the control's container changes. (Inherited from Control) OnReadOnlyChanged Raises the ReadOnlyChanged event. (Inherited from TextBoxBase) OnResize Raises the Resize event. (Inherited from Control) OnSizeChanged Raises the SizeChanged event. (Inherited from Control) OnSkinChanged Overriden. Raises the SkinChanged event. (Inherited from TextBoxBase) OnStyleChanged Raises the StyleChanged event. (Inherited from Control) OnTabIndexChanged Raises the TabIndexChanged event. (Inherited from Control) OnTabStopChanged Raises the TabStopChanged event. (Inherited from Control) OnTextAlignChanged Raises the TextAlignChanged event. (Inherited from TextBox) OnTextChanged Raises the TextChanged event. (Inherited from Control) OnValidated Raises the Validated event. (Inherited from Control) OnValidating Raises the Validating event. (Inherited from Control) OnVisibleChanged Raises the VisibleChanged event. (Inherited from Control) PerformLayout Overloaded. Forces the control to apply layout logic to all its child controls. (Inherited from Control) PointToClient Computes the location of the specified screen point into client coordinates. (Inherited from Control) PointToScreen Computes the location of the specified client point into screen coordinates. (Inherited from Control) ProcessDialogChar Processes a dialog character. (Inherited from Control) ProcessDialogKey Processes a dialog key. (Inherited from Control) ProcessMnemonic Processes a mnemonic character. (Inherited from Control) RecreateHandle Forces the re-creation of the handle for the control. (Inherited from Control) RectangleToClient Computes the size and location of the specified screen rectangle in client coordinates. (Inherited from Control) RectangleToScreen Computes the size and location of the specified client rectangle in screen coordinates. (Inherited from Control) ReferenceEquals Determines whether the specified Object instances are the same instance. (Inherited from Object) Refresh Forces the control to invalidate its client area and immediately redraw itself and any child controls. (Inherited from Control) ResetBackColor Resets the BackColor property to its default value. (Inherited from Control) ResetCursor Resets the Cursor property to its default value. (Inherited from Control) ResetFont Resets the Font property to its default value. (Inherited from Control) ResetForeColor Resets the ForeColor property to its default value. (Inherited from Control) ResetSkin Resets the Skin property to its default value. (Inherited from Control) ResetText Resets the Text property to its default value. (Inherited from Control) ResumeLayout Overloaded. Resumes normal layout logic. (Inherited from Control) ScrollToBottom Scrolls the contents of the control to the bottom of the TextBoxBase. (Inherited from TextBoxBase) Select Overloaded. Activates the control. (Inherited from Control) SelectAll Selects all text in the text box. (Inherited from TextBoxBase) SelectNextControl Activates the next control. (Inherited from Control) SendToBack Sends the control to the back of the z-order. (Inherited from Control) SetBounds Overloaded. Sets the bounds of the control to the specified location and size. (Inherited from Control) SetBoundsCore Overriden. Performs the work of setting the specified bounds of this TextBox. (Inherited from TextBox) SetClientSizeCore Sets the size of the client area of the control. (Inherited from Control) SetNCSizeCore Sets the non-client area of the control. (Inherited from Control) SetStyle Sets the specified style bit to the specified value. (Inherited from Control) SetTopLevel Sets the control as the top-level control. (Inherited from Control) SetVisibleCore Sets the control to the specified visible state. (Inherited from Control) Show Displays the control to the user. (Inherited from Control) SuspendLayout Temporarily suspends the layout logic for the control. (Inherited from Control) ToString Returns a String that represents the current Object. (Inherited from Object) Update Causes the control to redraw its client area if it was invalidated. (Inherited from Control) UpdateBounds Overloaded. Updates the bounds of the control with the current size and location. (Inherited from Control) UpdateZOrder Updates the control in its parent's z-order. (Inherited from Control) Properties
Property Description Anchor Gets or sets which edges of the control are anchored to the edges of its container. (Inherited from Control) AutoSize Gets or sets a value indicating whether the height of the TextBoxBase automatically adjusts when the font assigned to the control is changed. (Inherited from TextBoxBase) BackColor Overriden. Gets or sets the background color of the TextBoxBase. (Inherited from TextBoxBase) BackVisual Gets the visual of the control. (Inherited from Control) BorderStyle Gets or sets the border type of the TextBoxBase. (Inherited from TextBoxBase) Bottom Gets the distance between the bottom edge of the control and the top edge of its container's client area. (Inherited from Control) Bounds Gets or sets the size and location of the control including its nonclient elements. (Inherited from Control) CanFocus Gets a value indicating whether the control can receive focus. (Inherited from Control) CanSelect Gets a value indicating whether the control can be selected. (Inherited from Control) Capture Gets or sets a value indicating whether the control has captured the mouse. (Inherited from Control) CausesValidation Gets or sets a value indicating whether the control causes validation for any controls that require validation when it receives focus. (Inherited from Control) CharacterCasing Gets or sets a value indicating the case of characters of the text contained in the TextBox. (Inherited from TextBox) ClientRectangle Gets the rectangle that represents the client area of the control. (Inherited from Control) ClientSize Gets or sets the height and width of the client area of the control. (Inherited from Control) Container Gets the IContainer that contains the Component. (Inherited from Component) ContainsFocus Gets a value indicating whether the control or one of its child controls currently has the input focus. (Inherited from Control) ControlSkin Gets the ControlSkin of the control. (Inherited from Control) Controls Gets the collection of controls contained within the control. (Inherited from Control) Created Gets a value indicating whether the control has been created. (Inherited from Control) Cursor Gets or sets the cursor which is displayed when the mouse pointer is over the control. (Inherited from Control) DefaultBackColor Gets the default background color of the control. (Inherited from Control) DefaultFont Gets the default font of the control. (Inherited from Control) DefaultForeColor Gets the default foreground color of the control. (Inherited from Control) DefaultSize Overriden. Gets the default size of the HtmlBox. DefaultSkin Gets or sets the default skin of the control. (Inherited from Control) DisplayRectangle Gets the rectangle which represents the display area of the control. (Inherited from Control) Disposing Gets a value indicating whether the control is in the process of being disposed of. (Inherited from Control) Dock Gets or sets which edge of the parent container a control is docked to. (Inherited from Control) Enabled Gets or sets a value indicating whether the control can react to user interaction. (Inherited from Control) Focused Gets a value indicating whether the control has input focus. (Inherited from Control) Font Gets or sets the font of the text which is displayed by the control. (Inherited from Control) ForeColor Overriden. Gets or sets the foreground color of the TextBoxBase. (Inherited from TextBoxBase) Handle Gets the native handle that the control is bound to. (Inherited from Control) HasChildren Gets a value indicating whether the control has one or more child controls. (Inherited from Control) Height Gets or sets the height of the control. (Inherited from Control) IsDisposed Gets a value indicating whether the control has been disposed of. (Inherited from Control) IsHandleCreated Gets a value indicating whether the control has a handle associated with it. (Inherited from Control) Left Gets or sets the horizontal coordinate of a control's left edge. (Inherited from Control) Lines Gets or sets the lines of text in the TextBoxBase. (Inherited from TextBoxBase) Location Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container. (Inherited from Control) MaskVisual Gets the Visual which is the mask of the control. (Inherited from Control) MaxLength Gets or sets the maximum number of characters the user can type or paste into the TextBoxBase. (Inherited from TextBoxBase) Modified Gets or sets a value that indicating whether the TextBoxBase has been modified by the user since the control was created. (Inherited from TextBoxBase) ModifierKeys Gets a value indicating when one of the modifier keys (SHIFT, CTRL, and ALT) is pressed. (Inherited from Control) MouseButtons Gets a value indicating when one of the mouse buttons is clicked. (Inherited from Control) MousePosition Gets the position of the mouse cursor in global coordinates. (Inherited from Control) Multiline Overriden. Gets or sets a value indicating whether more than one row can be displayed in this TextBox. (Inherited from TextBox) NCVisual Gets the non-client visual element of the control. (Inherited from Control) Name Gets or sets the name of the control. (Inherited from Control) OverlayVisual Gets a visual placed over everything. (Inherited from Control) Parent Gets or sets the parent container of the control. (Inherited from Control) Parked Gets a value indicating whether the control is parked. (Inherited from Control) PasswordChar Gets or sets the character used to mask characters of a password in a single-line TextBox control. (Inherited from TextBox) PreferredHeight Gets the preferred height for a single-line TextBoxBase instance. (Inherited from TextBoxBase) ReadOnly Gets or sets a value indicating whether the text in this TextBoxBase is read-only. (Inherited from TextBoxBase) RecreatingHandle Gets a value indicating whether the control is currently re-creating its handle. (Inherited from Control) Right Gets the distance between the right edge of the control and the left edge of its container. (Inherited from Control) ScrollBars Gets or sets the scroll bars of a multiline TextBox control. (Inherited from TextBox) SelectedText Gets or sets the currently selected text in the TextBoxBase. (Inherited from TextBoxBase) SelectionLength Gets or sets the number of characters selected in the TextBoxBase. (Inherited from TextBoxBase) SelectionStart Gets or sets the starting point of text selected in the TextBoxBase. (Inherited from TextBoxBase) Site Gets or sets the ISite of the Component. (Inherited from Component) Size Gets or sets the height and width of the control. (Inherited from Control) Skin Gets or sets the skin of the control. (Inherited from Control) SystemMenu Gets or sets the SystemMenu of the control. (Inherited from Control) TabIndex Gets or sets the tab order of the control within its container. (Inherited from Control) TabStop Gets or sets a value indicating whether the user can use the TAB key to focus to the control. (Inherited from Control) Tag Gets or sets the object that contains data about the control. (Inherited from Control) Text Overriden. Gets or sets the current text in the TextBoxBase. (Inherited from TextBoxBase) TextAlign Gets or sets the alignment of the text in a TextBox control. (Inherited from TextBox) TextLength Gets the length of text in the TextBoxBase. (Inherited from TextBoxBase) Top Gets or sets the vertical coordinate of the control's top edge. (Inherited from Control) TopLevelControl Gets the parent control that is not parented by another Windows Forms control. (Inherited from Control) Visible Gets or sets a value indicating whether the control is visible. (Inherited from Control) Visual Gets the visual element of the control. (Inherited from Control) Width Gets or sets the width of the control. (Inherited from Control) WordWrap Gets or sets a value indicating whether a multiline TextBoxBase instance automatically wraps words to the beginning of the next line when necessary. (Inherited from TextBoxBase) Events
Event Description AutoSizeChanged Handles the changes of the AutoSize property. (Inherited from TextBoxBase) BackColorChanged Handles the changes of the BackColor property. (Inherited from Control) BorderStyleChanged Handles the changes of the BorderStyle property. (Inherited from TextBoxBase) CausesValidationChanged Handles the changes of the CausesValidation property. (Inherited from Control) Click Handles the click event when the control is clicked. (Inherited from Control) ClientSizeChanged Inherited from Control. ControlAdded Handles the addition of a new control when it is added to the Control.ControlCollection. (Inherited from Control) ControlRemoved Handles the remove of a control from the Control.ControlCollection. (Inherited from Control) CursorChanged Handles the changes of the Cursor property. (Inherited from Control) Disposed Adds an event handler to listen to the Disposed event on the component. (Inherited from Component) DockChanged Handles the changes of the Dock property. (Inherited from Control) DoubleClick Handles the double-clicked event of the control. (Inherited from Control) EnabledChanged Handles the changes of the Enabled property. (Inherited from Control) Enter Handles the entered event of the control. (Inherited from Control) FontChanged Handles the changes of the Font property. (Inherited from Control) ForeColorChanged Handles the changes of the ForeColor property. (Inherited from Control) GotFocus Handles the focus reception of the control. (Inherited from Control) HandleCreated Handles the creation of a handle for the control. (Inherited from Control) HandleDestroyed Handles the control's handle which is in the process of being destroyed. (Inherited from Control) KeyDown Handles the pressed key event when a key is pressed and the control has focus. (Inherited from Control) KeyPress Handles the pressed key event when a key is pressed and the control has focus. (Inherited from Control) KeyUp Handles the release key event when a key is released and the control has focus. (Inherited from Control) Layout Handles the changes of control when it should reposition its child controls. (Inherited from Control) Leave Handles the input focus when it leaves the control. (Inherited from Control) LinkClicked Appears when a hyperlink in the HtmlBox is clicked. LocationChanged Handles the changes of the Location property. (Inherited from Control) LostFocus Handles the focus on the control when it loses focus. (Inherited from Control) ModifiedChanged Handles the changes of the Modified property. (Inherited from TextBoxBase) MouseDown Handles the mouse event when the mouse pointer is over the control and a mouse button is pressed. (Inherited from Control) MouseEnter Handles the mouse event when the mouse pointer enters the control. (Inherited from Control) MouseLeave Handles the mouse event when the mouse pointer leaves the control. (Inherited from Control) MouseMove Handles the mouse event when the mouse pointer is moved over the control. (Inherited from Control) MouseUp Handles the mouse event when the mouse pointer is over the control and a mouse button is released. (Inherited from Control) MouseWheel Handles the mouse event when the mouse wheel moves while the control has focus. (Inherited from Control) Move Handles the motion of the control when it is moved. (Inherited from Control) MultilineChanged Handles the changes of the Multiline property. (Inherited from TextBoxBase) Paint Handles the paint event of the control when it is redrawn. (Inherited from Control) ParentChanged Handles the changes of the Parent property. (Inherited from Control) ReadOnlyChanged Handles the changes of the ReadOnly property. (Inherited from TextBoxBase) Resize Handles the size changes of the control when it is resized. (Inherited from Control) SizeChanged Handles the changes of the Size property. (Inherited from Control) SkinChanged Handles the changes of the Skin property. (Inherited from Control) StyleChanged Handles the changes of the control style. (Inherited from Control) TabIndexChanged Handles the changes of the TabIndex property. (Inherited from Control) TabStopChanged Handles the changes of the TabStop property. (Inherited from Control) TextAlignChanged Handles the changes of the TextAlign property. (Inherited from TextBox) TextChanged Handles the changes of the Text property. (Inherited from Control) Validated Handles the validation of the control when it is finished validating. (Inherited from Control) Validating Handles the validation of the control when it is validating. (Inherited from Control) VisibleChanged Determines the value of the VScroll property. (Inherited from Control)
Object
// This sample shows how to create a simple HtmlBox.
using System;
using System.Drawing;
using System.Windows.Forms;
public class MyForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.HtmlBox htmlbox1;
public MyForm()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.button1
= new System.Windows.Forms.Button();this.button1.Location= new System.Drawing.Point(30,30);
this.button1.Text= "Click me";
this.button1.Click += new EventHandler(on_click);
this.Controls.Add(this.button1);
this.htmlbox1= new System.Windows.Forms.HtmlBox();
this.htmlbox1.Location= new System.Drawing.Point(button1.Left, button1.Bottom + 10);
this.htmlbox1.Size= new Size( Application.Width-2*button1.Left, 155 );
this.htmlbox1.Multiline= true;
this.htmlbox1.ScrollBars= ScrollBars.Both;
this.Controls.Add(this.htmlbox1);
}
private void on_click( object sender, EventArgs e )
{
this.htmlbox1.Text= "<font face=\"arial\"><font size=\"24\">L'albatros</font><br>"
+ "<b>Charles Baudelaire</b><br>"
+ "<br>"
+ "Souvent, pour s'amuser, les hommes d'équipage<br>"
+ "Prennent des albatros, vastes oiseaux des mers,<br>"
+ "Qui suivent, indolents compagnons de voyage,<br>"
+ "Le navire glissant sur les gouffres amers.<br>"
+ "<br>"
+ "A peine les ont-ils déposés sur les planches,<br>"
+ "Que ces rois de l'azur, maladroits et honteux,<br>"
+ "Laissent piteusement leurs grandes ailes blanches<br>"
+ "Comme des avirons traîner à côté d'eux.<br>"
+ "<br>"
+ "Ce voyageur ailé, comme il est gauche et veule!<br>"
+ "Lui, naguère si beau, qu'il est comique et laid!<br>"
+ "L'un agace son bec avec un brûle-gueule,<br>"
+ "L'autre mime, en boitant, l'infirme qui volait!<br>"
+ "<br>"
+ "Le Poète est semblable au prince des nuées<br>"
+ "Qui hante la tempête et se rit de l'archer;<br>"
+ "Exilé sur le sol au milieu des huées,<br>"
+ "Ses ailes de géant l'empêchent de marcher.<br>"
+ "<br></font>";
}
static void Main()
{
Application.Run( new MyForm() );
}
}
Namespace System.Windows.Forms Flash Library System.Windows.Forms.scl Flash Library Version 2.0.0.2118 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |