I have a small application which embeds webbrowser controls. In that application I have created a popup class. This popup is used to display server generated error messages.
I want to be able to resize the popup to suit the message. This is so a short message is not contained in an oversize form and a large message is not in an undersized form.
Rather than send a width and height I would like to calculate the dimensions on the fly. I also did not want to visibly resize the form, that is just plain ugly.
Everything I try fails :(
This is what I thought should work
create the form
move it offscreen by setting its left position to -1000
show the form (offscreen)
write the contents to the webrowser ctl
get the width and height after it renders
hide the form
resize the form to fit the above width and height
center it onscreen
show the form
That should work just great, except the webbrowser control refuses to render, therefore I can't get the client width and height
Does anyone know how this can be done?
DC