Need to fire event AFTER a control is resized.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a control that the user is able to manually resize --- and it works
great. The problem is I need to handle something when the control is done
being resized, but not during the resize, so just putting what I need in the
resize event won't work. If it matters, the control is hosted on a
DesignSurface (system.componentmodel.design.DesignSurface).
 
Hi mfielder,

Thanks for your post!

In .Net Winform2.0, there is a new Form.ResizeEnd exposed, which is fired
when we finished resizing the Form. This event internally encapsulates
Win32 WM_EXITSIZEMOVE message. For more information, please refer to my
original thread below:
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/brow
se_thread/thread/f77a4f68c9944e89/40a4dc2ea543405a?lnk=st&q=%22Jeffrey+Tan%2
2+resize+resizeend&rnum=1&hl=zh-CN#40a4dc2ea543405a
Note: please take care of the link-break in the URL.

However, in your DesignSurface scenario, I think this is not what you want:
1. This event only exposes to the Form class.
2. DesignSurface provided the control design-time manipulation feature with
..Net winform code internally, it does not fire WM_EXITSIZEMOVE message even
to the Form class. I suspect it programmatically changes the Form/Controls
size internally.

So we can not use these runtime technologies to your design-time
application. I think we have to resort to the designer object model to get
the notification. What I can think of is getting IComponentChangeService
interface in the designer, then handling ComponentChanged event. There are
2 parameters we are interested in this event:
1. Component: we can use it to determine which component/control is
currently changed.
2. Member: we should monitor the "Size" property member

With monitoring these 2 parameters in the event, we determine it is "Size"
property that is changed just now. However, this requires some extra work
to be done.

Finally, you'd better post in .Net winform newsgroups for such issue.
Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
First off, I appologize for posting in the wrong group -- I'm new around
here. Is there a simple way to move this thread to the correct group?

On to the problem - I think that we're really headed in the right direction
- it looks like the interface mentioned is designed exactly with what I'm
trying to do in mind. The problem now is that I've added the interface to my
implementation of designsurface, but it doesn't appear that the events are
actaully firing. I can post the class if that helps, but not sure how to do
that.
 
If you need further help, please feel free to post. Thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top