Click or drag to resize
TextBox Class
A textbox used for displaying and accepting text.
Inheritance Hierarchy

Namespace: Mentula.GuiItems.Items
Assembly: XnaGuiItems (in XnaGuiItems.dll) Version: 1.0.0.0
Syntax
C#
public class TextBox : Label

The TextBox type exposes the following members.

Constructors
  NameDescription
Public methodTextBox(SpriteBatch, SpriteFont)
Initializes a new instance of the TextBox class with default settings.
Public methodTextBox(SpriteBatch, Rect, SpriteFont)
Initializes a new instance of the TextBox class with a specific size.
Top
Properties
  NameDescription
Public propertyAutoRefresh
Gets or sets a value indicating if the Label will call Refresh on a TextChanged event.
(Inherited from Label.)
Public propertyAutoSize
Gets or sets a value indicating if the Label will adjust its size to the text.
(Inherited from Label.)
Public propertyBackColor
Gets or sets the background color for the GuiItem.
(Inherited from GuiItem.)
Public propertyBackgroundImage
Gets or sets the background image displayed in the GuiItem.
(Inherited from GuiItem.)
Public propertyBorderStyle
Gets or sets the type of border given to the Label.
(Inherited from Label.)
Public propertyBounds
Gets or sets the size of the GuiItem including its nonclient elements in pixels.
(Inherited from GuiItem.)
Public propertyStatic memberDefaultMinimumSize
Gets the default minimum size of the TextBox.
Public propertyDisposing
Gets a value indicating wether the base GuiItem class is in the process of disposing.
(Inherited from GuiItem.)
Public propertyEnabled
Gets or sets a value indicating whether the GuiItem can respond to user interaction.
(Inherited from GuiItem.)
Public propertyFlickerStyle
Gets or sets a value indicating how the TextBox should flicker.
Public propertyFocused
Gets or sets a value indicating if the TextBox is in focus.
Public propertyFont
Gets or sets the font used by the Label.
(Inherited from Label.)
Public propertyForeColor
Gets or sets the foregound color for the GuiItem.
(Inherited from GuiItem.)
Public propertyForegroundRectangle
Gets or sets the Rectangle used to draw the text.
(Inherited from Label.)
Public propertyHeight
Gets or sets the height of the GuiItem including its nonclient elements in pixels.
(Inherited from GuiItem.)
Public propertyInputType
Gets or sets a value indicating the types of input allowed in this TextBox.
Public propertyIsDisposed
Gets a value indicating whether the GuiItem has been disposed.
(Inherited from GuiItem.)
Public propertyLineStart
Gets or sets a value indicating from what line the Label should be shown.
(Inherited from Label.)
Public propertyMaximumSize
Gets or sets a value indicating the maximum size of the TextBox. Default value is the screen size.
Public propertyMaxLength
Gets or sets a value indicating the maximum length of the text input. Negative values indicate no maximum length. Default value = -1
Public propertyMinimumSize
Gets or sets a value indicating the minimum size of the TextBox.
Public propertyMultiLine
Gets or sets a value indicating of the TextBox can be multiline.
Public propertyName
Gets or sets the name of the GuiItem.
(Inherited from GuiItem.)
Public propertyOrigin
Gets or sets a value indicating the origin of rotation.
(Inherited from GuiItem.)
Public propertyPasswordChar
Gets or set a value indicating if the TextBox is a password field and which char it should use. Default value = '\0' indicating that it is not a password field.
Public propertyPosition
Gets or sets the position of the GuiItem.
(Inherited from GuiItem.)
Public propertyRotation
Gets or sets the client side rotation of the GuiItem.
(Inherited from GuiItem.)
Public propertySize
Gets or sets the size of the GuiItem.
(Inherited from GuiItem.)
Public propertySuppressDraw (Inherited from GuiItem.)
Public propertySuppressUpdate (Inherited from GuiItem.)
Public propertyText
Gets or sets the text of the Label.
(Inherited from Label.)
Public propertyVisible
Gets or sets a value indicating whether the GuiItem is displayed.
(Inherited from GuiItem.)
Public propertyVisisbleText
Gets the visible text of the TextBox.
Public propertyWidth
Gets or sets the width of the GuiItem including its nonclient elements in pixels.
(Inherited from GuiItem.)
Public propertyX
Gets or sets the horizontal component of the GuiItem.
(Inherited from GuiItem.)
Public propertyY
Gets or sets the vertical component of the GuiItem.
(Inherited from GuiItem.)
Top
Methods
  NameDescription
Public methodDispose
Releases the managed and unmanaged resources used by the GuiItem.
(Inherited from GuiItem.)
Protected methodDispose(Boolean)
Releases the unmanaged and managed resources used by the GuiItem.
(Inherited from GuiItem.)
Public methodDraw
Draws the TextBox to the specified SpriteBatch.
(Overrides GuiItemDraw(SpriteBatch).)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Disposes the unmanaged resources.
(Inherited from GuiItem.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetLineCount
Get the number of lines in this Label
(Inherited from Label.)
Protected methodGetMouseEventArgs
Gets the mouse state as a MouseEventArgs object.
(Inherited from GuiItem.)
Protected methodCode exampleGetRotatedMouse
Gets the position of the mouse in respect to the GuiItem.
(Inherited from GuiItem.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHandleAutoSize
Handles the AutoSize functionality.
(Overrides LabelHandleAutoSize.)
Public methodHide
Disables the GuiItem and makes it hiden.
(Inherited from GuiItem.)
Protected methodInitEvents
Handles the initializing of the events.
(Overrides LabelInitEvents.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMoveRelative
Moves the GuiItem to a specified relative position. If x is set the horizontal component of the anchor will have no effect. If y is set the vertical component of the anchor will have no effect.
(Inherited from GuiItem.)
Protected methodOnBackColorChanged
This method is called when the BackColorChanged event is raised.
(Inherited from GuiItem.)
Protected methodOnBackgroundImageChanged
This method is called when the BackgroundImageChanged event is raised.
(Inherited from GuiItem.)
Protected methodOnEnabledChanged
This method is called when the EnabledChanged event is raised.
(Inherited from GuiItem.)
Protected methodOnFocusChanged
This method gets called when the FocusChanged event is raised.
Protected methodOnFontChanged
This method is called when the FontChanged event is raised.
(Inherited from Label.)
Protected methodOnForeColorChanged
This method is called when the ForeColorChanged event is raised.
(Inherited from Label.)
Protected methodOnMove
This method is called when the Moved event is raised.
(Inherited from Label.)
Protected methodOnNameChange
This method is called when the NameChanged event is raised.
(Inherited from GuiItem.)
Protected methodOnResize
This method is called when the Resized event is raised.
(Inherited from Label.)
Protected methodOnRotationChanged
This method is called when the Rotated event is raised.
(Inherited from GuiItem.)
Protected methodOnTextChanged
This method gets called when the TextChanged event is raised.
(Overrides LabelOnTextChanged(Label, ValueChangedEventArgsString).)
Protected methodOnVisibilityChanged
This method is called when the VisibilityChanged event is raised.
(Inherited from GuiItem.)
Public methodPerformClick
Perform a mouse click.
(Inherited from GuiItem.)
Public methodRefresh
Recalculates the background and the foreground.
(Inherited from Label.)
Protected methodSetBackgroundTexture
Sets the background texture for the Label.
(Inherited from Label.)
Protected methodSetForegroundTexture
Sets the foreground texture for the TextBox.
(Overrides LabelSetForegroundTexture.)
Protected methodSetTextureHandler
Sets textures to the required TextureHandler.
(Overrides LabelSetTextureHandler.)
Public methodShow
Enables the GuiItem and makes it visible.
(Inherited from GuiItem.)
Public methodToString
Returns a string that represents the current GuiItem.
(Inherited from GuiItem.)
Public methodUpdate
Updates the TextBox, checking if any mouse- or keyboard event are occuring. Use like: myTextBox.Update(Mouse.GetState(), Keyboard.GetState(), (float)gameTime.ElapsedGameTime.TotalSeconds);
(Overrides GuiItemUpdate(Single).)
Top
Events
  NameDescription
Public eventBackColorChanged
Occurs when the value of the BackColor property changes.
(Inherited from GuiItem.)
Public eventBackgroundImageChanged
Occurs when the value of the BackgroundImage property changes.
(Inherited from GuiItem.)
Public eventClicked
Occurs when the GuiItem is clicked.
(Inherited from GuiItem.)
Public eventConfirmed
Occures when return is pressed on a non MultiLineTextBox.
Public eventEnabledChanged
Occurs when the Enabled property changes.
(Inherited from GuiItem.)
Public eventFocusChanged
Occurs when the value of the Focused propery is changed.
Public eventFontChanged
Occurs when the value of the Font propery is changed.
(Inherited from Label.)
Public eventForeColorChanged
Occurs when the ForeColor property changes.
(Inherited from GuiItem.)
Public eventHover
Occurs when the mouse pointer rests on the GuiItem.
(Inherited from GuiItem.)
Public eventHoverEnter
Occurs when the mouse pointer enters the GuiItem.
(Inherited from GuiItem.)
Public eventHoverLeave
Occurs when the mouse pointer leaves the GuiItem.
(Inherited from GuiItem.)
Public eventMoved
Occurs when the GuiItem is moved.
(Inherited from GuiItem.)
Public eventNameChanged
Occurs when the Name proprty changes.
(Inherited from GuiItem.)
Public eventResized
Occurs when the GuiItem is resized.
(Inherited from GuiItem.)
Public eventRotated
Occurs when the Rotation propery changes.
(Inherited from GuiItem.)
Public eventTextChanged
Occurs when the value of the Text propery is changed.
(Inherited from Label.)
Public eventVisibilityChanged
Occurs when the Visible property changes.
(Inherited from GuiItem.)
Top
Fields
  NameDescription
Protected fieldbatch
The SpriteBatch used for generating the underlying Texture2D.
(Inherited from GuiItem.)
Protected fieldfont
The specified SpriteFont.
(Inherited from Label.)
Protected fieldforegroundRectangle
The rectangle used in the foreground.
(Inherited from Label.)
Protected fieldleftDown
Whether the GuiItem is left clicked.
(Inherited from GuiItem.)
Protected fieldover
Whether the Mouse is hovering over the GuiItem.
(Inherited from GuiItem.)
Protected fieldrightDown
Whether the GuiItem is right clicked.
(Inherited from GuiItem.)
Protected fieldtextures
Stores the Texture2D used for drawing.
(Inherited from GuiItem.)
Top
See Also