Class HexBox
Represents a hex box control.
Inherited Members
Namespace: Be.Windows.Forms
Assembly: Be.Windows.Forms.HexBox.dll
Syntax
[ToolboxBitmap(typeof(HexBox), "HexBox.bmp")]
public class HexBox : Control, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable
Constructors
View SourceHexBox()
Initializes a new instance of a HexBox class.
Declaration
public HexBox()
Properties
View SourceBackColor
Gets or sets the background color for the control.
Declaration
public override Color BackColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Overrides
View SourceBackColorDisabled
Gets or sets the background color for the disabled control.
Declaration
public Color BackColorDisabled { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
BorderStyle
Gets or sets the hex box´s border style.
Declaration
public BorderStyle BorderStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| BorderStyle |
BuiltInContextMenu
Gets or sets the built-in context menu.
Declaration
public BuiltInContextMenu BuiltInContextMenu { get; }
Property Value
| Type | Description |
|---|---|
| BuiltInContextMenu |
ByteCharConverter
Gets or sets the converter that will translate between byte and character values.
Declaration
[Browsable(false)]
public IByteCharConverter ByteCharConverter { get; set; }
Property Value
| Type | Description |
|---|---|
| IByteCharConverter |
ByteProvider
Gets or sets the ByteProvider.
Declaration
[Browsable(false)]
public IByteProvider? ByteProvider { get; set; }
Property Value
| Type | Description |
|---|---|
| IByteProvider |
BytesPerLine
Gets or sets the maximum count of bytes in one line.
Declaration
public int BytesPerLine { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
UseFixedBytesPerLine property no longer has to be set to true for this to work
CharSize
Contains the size of a single character in pixel
Declaration
public SizeF CharSize { get; }
Property Value
| Type | Description |
|---|---|
| SizeF |
ColumnInfoVisible
Gets or sets the visibility of the column info
Declaration
public bool ColumnInfoVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
CurrentFindingPosition
Gets a value that indicates the current position during Find method execution.
Declaration
[Browsable(false)]
public long CurrentFindingPosition { get; }
Property Value
| Type | Description |
|---|---|
| long |
CurrentLine
Gets the current line
Declaration
[Browsable(false)]
public long CurrentLine { get; }
Property Value
| Type | Description |
|---|---|
| long |
CurrentPositionInLine
Gets the current position in the current line
Declaration
[Browsable(false)]
public long CurrentPositionInLine { get; }
Property Value
| Type | Description |
|---|---|
| long |
Font
The font used to display text in the hexbox.
Declaration
public override Font Font { get; set; }
Property Value
| Type | Description |
|---|---|
| Font |
Overrides
View SourceGroupSeparatorVisible
Gets or sets the visibility of the group separator.
Declaration
public bool GroupSeparatorVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
GroupSize
Gets or sets the number of bytes in a group. Used to show the group separator line (if GroupSeparatorVisible is true)
Declaration
public int GroupSize { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
GroupSeparatorVisible property must set to true
HexCasing
Gets or sets whether the HexBox control displays the hex characters in upper or lower case.
Declaration
public HexCasing HexCasing { get; set; }
Property Value
| Type | Description |
|---|---|
| HexCasing |
HorizontalByteCount
Gets the number bytes drawn horizontally.
Declaration
[Browsable(false)]
public int HorizontalByteCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
InfoForeColor
Gets or sets the info color used for column info and line info. When this property is null, then ForeColor property is used.
Declaration
public Color InfoForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
InsertActive
Gets the a value if insertion mode is active or not.
Declaration
[Browsable(false)]
public bool InsertActive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LineInfoOffset
Gets or sets the offset of a line info.
Declaration
public long LineInfoOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
LineInfoVisible
Gets or sets the visibility of a line info.
Declaration
public bool LineInfoVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ReadOnly
Gets or sets if the count of bytes in one line is fix.
Declaration
public bool ReadOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
When set to True, BytesPerLine property determine the maximum count of bytes in one line.
RequiredWidth
Gets the width required for the content
Declaration
public int RequiredWidth { get; }
Property Value
| Type | Description |
|---|---|
| int |
SelectionBackColor
Gets or sets the background color for the selected bytes.
Declaration
public Color SelectionBackColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
SelectionForeColor
Gets or sets the foreground color for the selected bytes.
Declaration
public Color SelectionForeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
SelectionLength
Gets and sets the number of bytes selected in the hex box.
Declaration
[Browsable(false)]
public long SelectionLength { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
SelectionStart
Gets and sets the starting point of the bytes selected in the hex box.
Declaration
[Browsable(false)]
public long SelectionStart { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
ShadowSelectionColor
Gets or sets the color of the shadow selection.
Declaration
public Color ShadowSelectionColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
Remarks
A alpha component must be given! Default alpha = 100
ShadowSelectionVisible
Gets or sets the visibility of a shadow selection.
Declaration
public bool ShadowSelectionVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
StringViewVisible
Gets or sets the visibility of the string view.
Declaration
public bool StringViewVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UseFixedBytesPerLine
Gets or sets if the count of bytes in one line is fix.
Declaration
public bool UseFixedBytesPerLine { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
When set to True, BytesPerLine property determine the maximum count of bytes in one line.
VScrollBarVisible
Gets or sets the visibility of a vertical scroll bar.
Declaration
public bool VScrollBarVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
VerticalByteCount
Gets the number bytes drawn vertically.
Declaration
[Browsable(false)]
public int VerticalByteCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceAbortFind()
Aborts a working Find method.
Declaration
public void AbortFind()
CanCopy()
Return true if Copy method could be invoked.
Declaration
public bool CanCopy()
Returns
| Type | Description |
|---|---|
| bool |
CanCut()
Return true if Cut method could be invoked.
Declaration
public bool CanCut()
Returns
| Type | Description |
|---|---|
| bool |
CanPaste()
Return true if Paste method could be invoked.
Declaration
public bool CanPaste()
Returns
| Type | Description |
|---|---|
| bool |
CanPasteHex()
Return true if PasteHex method could be invoked.
Declaration
public bool CanPasteHex()
Returns
| Type | Description |
|---|---|
| bool |
CanSelectAll()
Returns true if Select method could be invoked.
Declaration
public bool CanSelectAll()
Returns
| Type | Description |
|---|---|
| bool |
Copy()
Copies the current selection in the hex box to the Clipboard.
Declaration
public void Copy()
CopyHex()
Copies the current selection in the hex box to the Clipboard in hex format.
Declaration
public void CopyHex()
Cut()
Moves the current selection in the hex box to the Clipboard.
Declaration
public void Cut()
Find(FindOptions)
Searches the current ByteProvider
Declaration
public long Find(FindOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| FindOptions | options | contains all find options |
Returns
| Type | Description |
|---|---|
| long | the SelectionStart property value if find was successfull or -1 if there is no match -2 if Find was aborted. |
GetParent<T>(Control)
Get Parent control of type T
Declaration
public static T GetParent<T>(Control c) where T : Control
Parameters
| Type | Name | Description |
|---|---|---|
| Control | c | the control |
Returns
| Type | Description |
|---|---|
| T | The parent control |
Type Parameters
| Name | Description |
|---|---|
| T | The type |
OnBorderStyleChanged(EventArgs)
Raises the BorderStyleChanged event.
Declaration
protected virtual void OnBorderStyleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnByteProviderChanged(EventArgs)
Raises the ByteProviderChanged event.
Declaration
protected virtual void OnByteProviderChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnBytesPerLineChanged(EventArgs)
Raises the BytesPerLineChanged event.
Declaration
protected virtual void OnBytesPerLineChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnColumnInfoVisibleChanged(EventArgs)
Raises the OnColumnInfoVisibleChanged event.
Declaration
protected virtual void OnColumnInfoVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnCopied(EventArgs)
Raises the Copied event.
Declaration
protected virtual void OnCopied(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnCopiedHex(EventArgs)
Raises the CopiedHex event.
Declaration
protected virtual void OnCopiedHex(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnCurrentLineChanged(EventArgs)
Raises the CurrentLineChanged event.
Declaration
protected virtual void OnCurrentLineChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnCurrentPositionInLineChanged(EventArgs)
Raises the CurrentPositionInLineChanged event.
Declaration
protected virtual void OnCurrentPositionInLineChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnDpiChangedAfterParent(EventArgs)
Supports DPI change event
Declaration
protected override void OnDpiChangedAfterParent(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | The event args |
Overrides
View SourceOnGotFocus(EventArgs)
Raises the GotFocus event.
Declaration
protected override void OnGotFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
Overrides
View SourceOnGroupSeparatorVisibleChanged(EventArgs)
Raises the ColumnSeparatorVisibleChanged event.
Declaration
protected virtual void OnGroupSeparatorVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnGroupSizeChanged(EventArgs)
Raises the GroupSizeChanged event.
Declaration
protected virtual void OnGroupSizeChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnHexCasingChanged(EventArgs)
Raises the HexCasingChanged event.
Declaration
protected virtual void OnHexCasingChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnHorizontalByteCountChanged(EventArgs)
Raises the HorizontalByteCountChanged event.
Declaration
protected virtual void OnHorizontalByteCountChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnInsertActiveChanged(EventArgs)
Raises the InsertActiveChanged event.
Declaration
protected virtual void OnInsertActiveChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnLineInfoVisibleChanged(EventArgs)
Raises the LineInfoVisibleChanged event.
Declaration
protected virtual void OnLineInfoVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnLostFocus(EventArgs)
Raises the LostFocus event.
Declaration
protected override void OnLostFocus(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
Overrides
View SourceOnMouseDown(MouseEventArgs)
Raises the MouseDown event.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | An EventArgs that contains the event data. |
Overrides
View SourceOnMouseWheel(MouseEventArgs)
Raises the MouseWhell event
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| MouseEventArgs | e | An EventArgs that contains the event data. |
Overrides
View SourceOnPaint(PaintEventArgs)
Paints the hex box.
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| PaintEventArgs | e | A PaintEventArgs that contains the event data. |
Overrides
View SourceOnPaintBackground(PaintEventArgs)
Paints the background.
Declaration
protected override void OnPaintBackground(PaintEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| PaintEventArgs | e | A PaintEventArgs that contains the event data. |
Overrides
View SourceOnReadOnlyChanged(EventArgs)
Raises the ReadOnlyChanged event.
Declaration
protected virtual void OnReadOnlyChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnResize(EventArgs)
Raises the Resize event.
Declaration
protected override void OnResize(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
Overrides
View SourceOnSelectionLengthChanged(EventArgs)
Raises the SelectionLengthChanged event.
Declaration
protected virtual void OnSelectionLengthChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnSelectionStartChanged(EventArgs)
Raises the SelectionStartChanged event.
Declaration
protected virtual void OnSelectionStartChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnStringViewVisibleChanged(EventArgs)
Raises the StringViewVisibleChanged event.
Declaration
protected virtual void OnStringViewVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnUseFixedBytesPerLineChanged(EventArgs)
Raises the UseFixedBytesPerLineChanged event.
Declaration
protected virtual void OnUseFixedBytesPerLineChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnVScrollBarVisibleChanged(EventArgs)
Raises the VScrollBarVisibleChanged event.
Declaration
protected virtual void OnVScrollBarVisibleChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
OnVerticalByteCountChanged(EventArgs)
Raises the VerticalByteCountChanged event.
Declaration
protected virtual void OnVerticalByteCountChanged(EventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| EventArgs | e | An EventArgs that contains the event data. |
Paste()
Replaces the current selection in the hex box with the contents of the Clipboard.
Declaration
public void Paste()
PasteHex()
Replaces the current selection in the hex box with the hex string data of the Clipboard.
Declaration
public void PasteHex()
PreProcessMessage(ref Message)
Preprocesses windows messages.
Declaration
public override bool PreProcessMessage(ref Message m)
Parameters
| Type | Name | Description |
|---|---|---|
| Message | m | the message to process. |
Returns
| Type | Description |
|---|---|
| bool | true, if the message was processed |
Overrides
View SourceScrollByteIntoView()
Scrolls the selection start byte into view
Declaration
public void ScrollByteIntoView()
ScrollByteIntoView(long)
Scrolls the specific byte into view
Declaration
public void ScrollByteIntoView(long index)
Parameters
| Type | Name | Description |
|---|---|---|
| long | index | the index of the byte |
Select(long, long)
Selects the hex box.
Declaration
public void Select(long start, long length)
Parameters
| Type | Name | Description |
|---|---|---|
| long | start | the start index of the selection |
| long | length | the length of the selection |
SelectAll()
Selects all bytes.
Declaration
public void SelectAll()
Events
View SourceBorderStyleChanged
Occurs, when the value of BorderStyle property has changed.
Declaration
public event EventHandler BorderStyleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
ByteProviderChanged
Occurs, when the value of ByteProvider property has changed.
Declaration
public event EventHandler ByteProviderChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
BytesPerLineChanged
Occurs, when the value of BytesPerLine property has changed.
Declaration
public event EventHandler BytesPerLineChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
CharSizeChanged
Occurs, when the CharSize property has changed
Declaration
public event EventHandler CharSizeChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
ColumnInfoVisibleChanged
Occurs, when the value of ColumnInfoVisibleChanged property has changed.
Declaration
public event EventHandler ColumnInfoVisibleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
Copied
Occurs, when Copy method was invoked and ClipBoardData changed.
Declaration
public event EventHandler Copied
Event Type
| Type | Description |
|---|---|
| EventHandler |
CopiedHex
Occurs, when CopyHex method was invoked and ClipBoardData changed.
Declaration
public event EventHandler CopiedHex
Event Type
| Type | Description |
|---|---|
| EventHandler |
CurrentLineChanged
Occurs, when the value of CurrentLine property has changed.
Declaration
public event EventHandler CurrentLineChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
CurrentPositionInLineChanged
Occurs, when the value of CurrentPositionInLine property has changed.
Declaration
public event EventHandler CurrentPositionInLineChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
GroupSeparatorVisibleChanged
Occurs, when the value of GroupSeparatorVisibleChanged property has changed.
Declaration
public event EventHandler GroupSeparatorVisibleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
GroupSizeChanged
Occurs, when the value of ColumnWidth property has changed.
Declaration
public event EventHandler GroupSizeChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
HexCasingChanged
Occurs, when the value of HexCasing property has changed.
Declaration
public event EventHandler HexCasingChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
HorizontalByteCountChanged
Occurs, when the value of HorizontalByteCount property has changed.
Declaration
public event EventHandler HorizontalByteCountChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
InsertActiveChanged
Occurs, when the value of InsertActive property has changed.
Declaration
public event EventHandler InsertActiveChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
LineInfoVisibleChanged
Occurs, when the value of LineInfoVisible property has changed.
Declaration
public event EventHandler LineInfoVisibleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
ReadOnlyChanged
Occurs, when the value of ReadOnly property has changed.
Declaration
public event EventHandler ReadOnlyChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
RequiredWidthChanged
Occurs, when the RequiredWidth property changes
Declaration
public event EventHandler RequiredWidthChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
SelectionLengthChanged
Occurs, when the value of SelectionLength property has changed.
Declaration
public event EventHandler SelectionLengthChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
SelectionStartChanged
Occurs, when the value of SelectionStart property has changed.
Declaration
public event EventHandler SelectionStartChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
StringViewVisibleChanged
Occurs, when the value of StringViewVisible property has changed.
Declaration
public event EventHandler StringViewVisibleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
UseFixedBytesPerLineChanged
Occurs, when the value of UseFixedBytesPerLine property has changed.
Declaration
public event EventHandler UseFixedBytesPerLineChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
VScrollBarVisibleChanged
Occurs, when the value of VScrollBarVisible property has changed.
Declaration
public event EventHandler VScrollBarVisibleChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |
VerticalByteCountChanged
Occurs, when the value of VerticalByteCount property has changed.
Declaration
public event EventHandler VerticalByteCountChanged
Event Type
| Type | Description |
|---|---|
| EventHandler |