Implemented resizelayout.