Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / ContainerSelectorGlyph.cs / 1 / ContainerSelectorGlyph.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.Drawing.Drawing2D; using System.Windows.Forms.Design; using System.Windows.Forms; ////// /// This is the glyph used to drag container controls around the designer. /// This glyph (and associated behavior) is created by the ParentControlDesigner. /// internal sealed class ContainerSelectorGlyph : Glyph { private Rectangle glyphBounds; private ContainerSelectorBehavior relatedBehavior; ////// /// ContainerSelectorGlyph constructor. /// internal ContainerSelectorGlyph(Rectangle containerBounds, int glyphSize, int glyphOffset, ContainerSelectorBehavior behavior) : base(behavior) { relatedBehavior = (ContainerSelectorBehavior)behavior; glyphBounds = new Rectangle(containerBounds.X + glyphOffset, containerBounds.Y - (int)(glyphSize * .5), glyphSize, glyphSize); } ////// /// The bounds of this Glyph. /// public override Rectangle Bounds { get { return glyphBounds; } } public Behavior RelatedBehavior { get { return relatedBehavior; } } ////// /// Simple hit test rule: if the point is contained within the bounds /// - then it is a positive hit test. /// public override Cursor GetHitTest(Point p) { if (glyphBounds.Contains(p) || relatedBehavior.OkToMove) { return Cursors.SizeAll; } return null; } private Bitmap glyph = null; private Bitmap MoveGlyph { get { if (glyph == null) { glyph = new Bitmap(typeof(ContainerSelectorGlyph), "MoverGlyph.bmp"); glyph.MakeTransparent(); } return glyph; } } ////// /// Very simple paint logic. /// public override void Paint(PaintEventArgs pe) { pe.Graphics.DrawImage(MoveGlyph, glyphBounds); } } } // 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
- ChangeBlockUndoRecord.cs
- ToolStripSplitStackLayout.cs
- TrackingProfileCache.cs
- Vector3DAnimation.cs
- RequestQueue.cs
- XsltArgumentList.cs
- OleDbParameterCollection.cs
- ContainerSelectorBehavior.cs
- HandleCollector.cs
- WebPartManager.cs
- BindingManagerDataErrorEventArgs.cs
- PropertyFilterAttribute.cs
- WebReferencesBuildProvider.cs
- EmptyReadOnlyDictionaryInternal.cs
- WindowsButton.cs
- DrawingContextWalker.cs
- EmbeddedMailObject.cs
- Model3D.cs
- WebSysDescriptionAttribute.cs
- ActivityFunc.cs
- DataTableNewRowEvent.cs
- EmbeddedMailObjectCollectionEditor.cs
- ForEachAction.cs
- SectionVisual.cs
- NonParentingControl.cs
- UndirectedGraph.cs
- storepermissionattribute.cs
- WizardSideBarListControlItemEventArgs.cs
- StylusPointDescription.cs
- Message.cs
- VSDExceptions.cs
- ReplyChannel.cs
- DecimalConverter.cs
- JournalNavigationScope.cs
- RelatedEnd.cs
- AuthenticationModuleElementCollection.cs
- xml.cs
- RoutedEventHandlerInfo.cs
- WebBrowserNavigatingEventHandler.cs
- XmlSchemaAttribute.cs
- ReadOnlyCollectionBase.cs
- LiteralSubsegment.cs
- TypedElement.cs
- FileDialog.cs
- DataKeyCollection.cs
- PropertyInfo.cs
- PageHandlerFactory.cs
- WriterOutput.cs
- MinimizableAttributeTypeConverter.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- Visual3DCollection.cs
- PropertyGridEditorPart.cs
- DynamicValidator.cs
- MergablePropertyAttribute.cs
- ErrorTableItemStyle.cs
- XmlSchemaValidationException.cs
- AssemblyBuilder.cs
- Pair.cs
- SqlDataSourceWizardForm.cs
- DataGridRow.cs
- OdbcConnectionFactory.cs
- SecurityHelper.cs
- TextBoxAutoCompleteSourceConverter.cs
- HiddenField.cs
- EventLogPermissionEntry.cs
- LocationUpdates.cs
- ImageAnimator.cs
- coordinatorscratchpad.cs
- SpeechAudioFormatInfo.cs
- ComponentCommands.cs
- WindowHelperService.cs
- WebConfigurationManager.cs
- EpmTargetTree.cs
- QueryOptionExpression.cs
- DataGridViewComboBoxEditingControl.cs
- ProcessThreadCollection.cs
- ExternalFile.cs
- DuplexChannel.cs
- StateFinalizationActivity.cs
- TreeNodeEventArgs.cs
- HandleRef.cs
- CacheMemory.cs
- QueryGeneratorBase.cs
- InputScopeConverter.cs
- TraceLevelStore.cs
- ProgressChangedEventArgs.cs
- CodeGroup.cs
- WebPartManagerInternals.cs
- HttpRuntimeSection.cs
- AddressUtility.cs
- OrderingInfo.cs
- Button.cs
- FilePrompt.cs
- C14NUtil.cs
- XmlSchemaSimpleTypeRestriction.cs
- KeyPressEvent.cs
- cookiecollection.cs
- SqlInfoMessageEvent.cs
- StylusDevice.cs
- indexingfiltermarshaler.cs