Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / ToolboxSnapDragDropEventArgs.cs / 1 / ToolboxSnapDragDropEventArgs.cs
namespace System.Windows.Forms.Design.Behavior { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; using System.Diagnostics; using System.Drawing; using System.Windows.Forms.Design; ////// /// This class is created by the ToolboxItemSnapLineBehavior when the /// user clicks, drags, and drops a control from the toolbox. This class /// adds value to the standard DragEventArgs by holding information /// about how the user snapped a control when it was dropped. We'll /// use this information in ParentControlDesigner when this new control /// is created to properly position and size the new control. /// internal sealed class ToolboxSnapDragDropEventArgs : DragEventArgs { private SnapDirection snapDirections;//direction in which the user's cursor was snapped private Point offset;//offset from the cursor to our 'drag box' ////// /// Constructor that is called when the user drops - here, we'll essentially /// push the original drag event info down to the base class and store off /// our direction and offset. /// public ToolboxSnapDragDropEventArgs(SnapDirection snapDirections, Point offset, DragEventArgs origArgs) : base (origArgs.Data, origArgs.KeyState, origArgs.X, origArgs.Y, origArgs.AllowedEffect, origArgs.Effect) { this.snapDirections = snapDirections; this.offset = offset; } ////// /// This is the last direction that the user was snapped to directly before /// the drop happened... /// public SnapDirection SnapDirections { get { return snapDirections; } } ////// /// The offset in pixel between the mouse cursor (at time of drop) and the /// 'drag box' that is dancing around and snapping to other components. /// public Point Offset { get { return offset; } } ////// /// Flag enum used to define the different directions a 'drag box' could be /// snapped to. /// [Flags] public enum SnapDirection { None = 0x00, Top = 0x01, Bottom = 0x02, Right = 0x04, Left = 0x08 } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProcessModuleCollection.cs
- OuterGlowBitmapEffect.cs
- WinCategoryAttribute.cs
- input.cs
- TypedTableBase.cs
- ImageListStreamer.cs
- HtmlImage.cs
- DataGridViewCellFormattingEventArgs.cs
- NoPersistScope.cs
- ProcessModule.cs
- RegexCode.cs
- ListBoxAutomationPeer.cs
- DataGridViewHitTestInfo.cs
- HotSpotCollection.cs
- DateTimeConverter.cs
- DataRelationPropertyDescriptor.cs
- HierarchicalDataBoundControlAdapter.cs
- ProcessProtocolHandler.cs
- AssertUtility.cs
- SqlDataSourceFilteringEventArgs.cs
- TextTrailingCharacterEllipsis.cs
- ObjectConverter.cs
- UserControlCodeDomTreeGenerator.cs
- NotCondition.cs
- EventPropertyMap.cs
- EnumUnknown.cs
- SafeWaitHandle.cs
- FormParameter.cs
- WindowsListViewItemCheckBox.cs
- BuildDependencySet.cs
- ToolboxService.cs
- BinaryCommonClasses.cs
- CustomActivityDesigner.cs
- NativeMethods.cs
- ProcessModelInfo.cs
- CleanUpVirtualizedItemEventArgs.cs
- SqlDataSourceView.cs
- SelectionListDesigner.cs
- ToolStripGripRenderEventArgs.cs
- RadialGradientBrush.cs
- BufferAllocator.cs
- ClickablePoint.cs
- ActivityInterfaces.cs
- DocumentViewerHelper.cs
- ZipIOExtraField.cs
- PathNode.cs
- TTSEngineProxy.cs
- PolygonHotSpot.cs
- SqlConnection.cs
- SelectionEditingBehavior.cs
- DeliveryRequirementsAttribute.cs
- HtmlWindowCollection.cs
- ConfigurationErrorsException.cs
- BaseDataBoundControl.cs
- TextElement.cs
- TrustManager.cs
- ItemsPanelTemplate.cs
- InstancePersistence.cs
- SchemaManager.cs
- AnnotationService.cs
- EventBindingService.cs
- Validator.cs
- LongMinMaxAggregationOperator.cs
- codemethodreferenceexpression.cs
- SupportedAddressingMode.cs
- MatrixTransform.cs
- XslNumber.cs
- ElementAction.cs
- Math.cs
- TypeViewSchema.cs
- DataGridViewColumnCollection.cs
- ServiceHostFactory.cs
- LongCountAggregationOperator.cs
- ItemsControl.cs
- ModulesEntry.cs
- ComplexObject.cs
- CellTreeSimplifier.cs
- QilScopedVisitor.cs
- XslVisitor.cs
- BrowserInteropHelper.cs
- CompatibleIComparer.cs
- PreservationFileWriter.cs
- EntityContainerRelationshipSet.cs
- AnnotationStore.cs
- HandleCollector.cs
- BindingValueChangedEventArgs.cs
- WebEventCodes.cs
- URL.cs
- PropertyMetadata.cs
- OverlappedContext.cs
- DataChangedEventManager.cs
- TypeDelegator.cs
- ComPlusDiagnosticTraceSchemas.cs
- GroupLabel.cs
- EncryptedType.cs
- TraceSource.cs
- ContactManager.cs
- ProvidersHelper.cs
- CultureMapper.cs
- DoubleAnimationUsingPath.cs