Recommendations for a Hex Viewer Control for Windows.Forms?
Wpf Hexeditor is a powerful and fully customisable user control for editing file or stream as hexadecimal, decimal and binary.
You can use it very easily in Wpf or WinForm application. Download the code and test the Wpf (C#, VB.NET) and WinForm (C#) samples.
https://github.com/abbaye/WPFHexEditorControl
<!-- XAML -->
<Control:HexaEditor/>
<Control:HexaEditor Width="NaN" Height="NaN"/>
<Control:HexaEditor Width="Auto" Height="Auto"/>
<Control:HexaEditor FileName={Binding FileNamePath} Width="Auto" Height="Auto"/>
I have always used http://sourceforge.net/projects/hexbox/ which has a HexEditor control but can be also used in a read only mode.
There is a ByteViewer Control directly available in the .NET Framework. Here is how you can use it in a sample Winforms C# application (note: you need to reference the System.Design
assembly):
public Form1()
{
InitializeComponent();
...
ByteViewer bv = new ByteViewer();
bv.SetFile(@"c:\windows\notepad.exe"); // or SetBytes
Controls.Add(bv);
}
And here is how it looks like: