Hints and FAQ


Q1: How can I load the contents of an AnsiString or WideString?

A: You should do it using OpenStream method, giving it a TMemoryStream as a parameter. Sample procedures for AnsiString and WideString are shown below. Note that you should free stream only after calling Viewer.OpenStream(nil), otherwise control will try to read deallocated memory on scrolling!


Q2: I have an issue with horizontal scrollbar. Even when text becomes short enough, scrollbar doesn't disappear...

A: This is done as workaround for Windows XP bug: when scrollbar is about to disappear, this may cause both scrollbars and window border to disappear. You can disable this workaround by commenting the "HSCROLLBAR_WORKAROUND" define in ATBinHexOptions.inc.

The RichEdit control doesn't have this problem because it precalculates widths for all strings and sets scrollbar size to the max value. We cannot do this in ATBinHex control, so the scrollbar size is calculated dinamically.


Q3: After changing a property, it is not applied.

A: Many properties require that after changing them, file should be reopened (using Open/Reload methods).