The layout of the toolbar depends on the size of its bitmaps, which changes when the DPI does, so call Realize() again when this happens. This fixes the layout of the toolbars in the aui sample when moving it between screens using different DPI.