I have a Progress.Windows.Form that contains an UltraExplorerBar and a WindowContainer.
When I embed a GUI window in the WindowContainer (Dock:Fill) that is too small scrollbars appear.
Then I query the size of the main frame in the embedded window and increase the Form size where necessary.
The Form resizes correctly, but the WindowContainer does not. The scrollbar(s) remain visible and the background of the Form becomes visible in the resized area.
As soon as I manually touch the size of the Form the WindowContainer the WindowContainer fills the Form again and the scrollbars disappear.
So manually it works fine, but programmatically does not work out the same. I have been looking for OnResize or something like that but that does not exist for a Form.
Any ideas?
Hi,
Thank you for your email. I'm currently out of the office. I will return on August 29. During my absence I will have no/limited access access to email. For urgent matters, call me on my mobile and leave a message, call our office, or contact Gary Calcott (gcalcott@progress.com).
Best regards,
Wouter
--
Wouter Dupré
Senior Solutions Consultant
Progress Software NV
A. Stocletlaan 202 B | B-2570 Duffel | Belgium
Office +32 (0) 15 30 77 00 | Mobile +32 (0) 478 50 00 49
Any ideas?
Sounds strange and doesn't occur to me.
Can you share a small sample that illustrates the messy behavior?
rbf wrote:
So manually it works fine, but programmatically does not work out the same. I have been looking for OnResize or something like that but that does not exist for a Form.
Any ideas?
Peter,
I see a SizeChanged event on both the WindowContainer and Form (they inherit it from the Control - http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged(v=VS.85).aspx ).
Do you not see those events?
-- peter
mikefe wrote:
Any ideas?
Sounds strange and doesn't occur to me.
Can you share a small sample that illustrates the messy behavior?
I am busy trying to create a reproduction but have not succeeded yet.
The real program is quite complicated and I am stripping it down.
Maybe I will run into the solution while doing that, will keep you posted.
pjudge wrote:
rbf wrote:
So manually it works fine, but programmatically does not work out the same. I have been looking for OnResize or something like that but that does not exist for a Form.
Any ideas?
Peter,
I see a SizeChanged event on both the WindowContainer and Form (they inherit it from the Control - http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged(v=VS.85).aspx ).
Do you not see those events?
-- peter
Peter,
Yes I see those events but I understand in order to raise them from the ABL I need an OnSizeChanged method?!?
-peter
Yes I see those events but I understand in order to raise them from the ABL I need an OnSizeChanged method?!?
I don't see why you'd need to raise them manually...
Peter,
Yes I see those events but I understand in order to raise them from the ABL I need an OnSizeChanged method?!?
-peter
Take a look at the last comment in http://www.pcreview.co.uk/forums/onresize-and-onsizechanged-t1313419.html , via http://stackoverflow.com/questions/4499983/onresize-vs-onsizechanged has some interesting info. Summarised, if you change the Size property programatically, the SizeChanged event will fire, to which you can subscribe. The Resize event only fires via Windows messages (ie when the form is manually resized).
-- peter
But he shouldn't need any of the events when the Form is Docking.
Peter (van Dam), are you overriding any of the event methods (On....) of the Form and not properly calling the SUPER:On.... Method?
mikefe wrote:
But he shouldn't need any of the events when the Form is Docking.
Peter (van Dam), are you overriding any of the event methods (On....) of the Form and not properly calling the SUPER:On.... Method?
No I don't.
pjudge wrote:
Peter,
Yes I see those events but I understand in order to raise them from the ABL I need an OnSizeChanged method?!?
-peter
Take a look at the last comment in http://www.pcreview.co.uk/forums/onresize-and-onsizechanged-t1313419.html , via http://stackoverflow.com/questions/4499983/onresize-vs-onsizechanged has some interesting info. Summarised, if you change the Size property programatically, the SizeChanged event will fire, to which you can subscribe. The Resize event only fires via Windows messages (ie when the form is manually resized).
-- peter
I see what you are saying (you are describing my problem) but not how I can solve my problem?!?
Peter,
Does setting the Size property to some newly calculated value not fire the SizeChanged event?
-- peter
pjudge wrote:
Peter,
Does setting the Size property to some newly calculated value not fire the SizeChanged event?
-- peter
I just checked and the SizeChanged event fires.
What can I do next?
Were you able to reproduce this in a sample you can share?
No I have not been able to produce a simple reproduction.
Peter the SizeChanged event fires. What can I do now? I am still struggling with this problem.
For the record, with the help of Mike Fechner this problem has been solved.
The reason for the strange behavior was that in this case the Form became smaller during the Show() method. The decrease in size was equal to the border widths. When I compensated for that everything worked correctly.
Mike and I are not able to explain why this phenomena occurs in my program as it normally does not, but hey, my problem is solved!