The event handler receives an argument of type BeforeColRegionSizeEventArgs containing data related to this event. The following BeforeColRegionSizeEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from System.ComponentModel.CancelEventArgs) | |
Region1 | The column scroll region 1 (read-only) |
Region2 | The column scroll region 2 (read-only) |
The region1 argument returns a reference to a ColScrollRegion object that can be used to set properties of, and invoke methods on, the leftmost colscrollregion that will be sized. You can use this reference to access any of the returned colscrollregion's properties or methods. However, the Width property of this rowscrollregion is read-only in this event procedure.
The region2 argument returns a reference to a ColScrollRegion object that can be used to set properties of, and invoke methods on, the rightmost colscrollregion that will be sized. You can use this reference to access any of the returned colscrollregion's properties or methods. However, the Width property of this rowscrollregion is read-only in this event procedure.
The cancel argument enables you to programmatically prevent the colscrollregions from sizing. This argument can be used to prevent the user from resizing the colscrollregions unless a certain condition is met. To prevent users from actually moving the colscrollregion's splitter bar, set its SizingMode property to 0 (SizingModeFixed).
This event is generated before a colscrollregion is sized, either programmatically, or by user interaction. A colscrollregion can be sized programmatically by setting its Width property. Because colscrollregions are vertical scrolling regions, the height of all colscrollregions will always be identical. Attempting to set the Width property of a rowscrollregion being sized in this event procedure, however, will generate an error.
The BeforeColRegionSplit event is generated before a colscrollregion is split into two colscrollregions.
The AfterColRegionSize event, which occurs after a colscrollregion was sized, is generated after this event, provided cancel is not set to True.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2