Hi All,
I have a windows application that has a form that gets sized based on the
content of a rich text control. I've set the StartPosition of the form to
CenterParent. In design mode the form is about 700 pixels wide. I've handled
the SizeChanged event of the richtextbox to set the width of the form.
Now the problem I'm facing is that when the form is displayed for the first
time the left/top position is calculated on the basis of the original
dimensions of the form and not the changed ones. Due to this it does not
appear centered in the parent form, though .NET thinks that it positioned
the form in the center as it is used the original dimensions to calculate
the left/top position. After dismissing the form and opening it again will
correctly center it within the parent form, because the width got changed
the first time and now the CenterParent is calculated properly. But I want
it centered the first time round and everytime.
Thanks in advance.
SK