public HexEditor(byte[] buffer) { Shown += HexEditor_Shown; InitializeComponent(); hexEditor = new HexEditBox(); hexEditor.InitializeComponent(); hexEditor.Dock = DockStyle.Fill; hexEditor.Font = new Font(hexEditor.Font.FontFamily, 12.0F); Controls.Add(hexEditor); input = buffer; }
private void SetupHexBox(HexEditBox hexEditBox1) { hexEditBox1.BackColor = System.Drawing.SystemColors.Window; hexEditBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; hexEditBox1.BytesPerLine = 16; hexEditBox1.Font = new System.Drawing.Font("Courier New", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); hexEditBox1.SetData(ParentFile.GetFileData()); hexEditBox1.AllowEdit = false; hexEditBox1.OffsetBytes = 4; hexEditBox1.ShowOffsetPrefix = true; hexEditBox1.BaseOffset = Offset; }
public void ShowControl(Panel Parent) { Parent.FindForm().SuspendLayout(); EditControl = new HexEditBox(); SetupHexBox((HexEditBox)EditControl); EditControl.Parent = Parent; Parent.ClientSize = EditControl.Size; EditControl.Dock = DockStyle.Fill; Parent.Visible = true; Parent.FindForm().ResumeLayout(); }