auto resizing dialogue box when window size changes