Modal Popup - Prevent Window dragging

Topics: CAB & Smart Client Software Factory
Dec 18, 2007 at 11:51 AM
Edited Dec 18, 2007 at 11:52 AM
Hi,
I am creating a modal Popup but i want to disallow the user from being able to increase/decrease the size of the window by dragging on the bottom right corner of the pane. Can somebody let me know if there is a way to do this as changing the relevant properties of the user control does not work, perhaps I must add in a property to the smartpartinfo class and if so a help with this would be greatly appreciated as i have wasted a lot of time on this seemingly trivial issue
Thanks
John
Dec 26, 2007 at 8:42 PM
Hi.

The Infrastructure.Library.UI project generated with the Smart Client Software Factory defines a WindowSmartPartInfo class (which is a subclass of the CAB WindowSmartPartInfo that exposes a property bag for adding new properties) and a WindowWorkspace class (which uses the property bag).

To prevent users from resizing the form window, you can use both as follows:

IMyView view = WorkItem.SmartParts.AddNew<MyView>();
Infrastructure.Library.UI.WindowSmartPartInfo info = new Infrastructure.Library.UI.WindowSmartPartInfo();
info.Keys.Add(WindowWorkspaceSetting.FormBorderStyle, FormBorderStyle.FixedDialog);
WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(view, info);
Please let me know if this helps.

Ignacio Baumann Fonay
http://staff.southworks.net/blogs/ibaumann/