Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / NoResizeHandleGlyph.cs / 1 / NoResizeHandleGlyph.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.Runtime.InteropServices; ////// /// The NoResizeHandleGlyph represents the handle for a non-resizeable control in our new seleciton /// model. Note that the pen and brush are created once per instance of this class /// and re-used in our painting logic for perf. reasonse. /// internal class NoResizeHandleGlyph : SelectionGlyphBase { private bool isPrimary = false; ////// /// NoResizeHandleGlyph's constructor takes additional parameters: 'type' and 'primary selection'. /// Also, we create/cache our pen & brush here to avoid this action with every paint message. /// internal NoResizeHandleGlyph(Rectangle controlBounds, SelectionRules selRules, bool primarySelection, Behavior behavior) : base(behavior) { isPrimary = primarySelection; hitTestCursor = Cursors.Default; rules = SelectionRules.None; if ((selRules & SelectionRules.Moveable) != 0) { rules = SelectionRules.Moveable; hitTestCursor = Cursors.SizeAll; } // The handle is always upperleft bounds = new Rectangle(controlBounds.X - DesignerUtils.NORESIZEHANDLESIZE, controlBounds.Y - DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE, DesignerUtils.NORESIZEHANDLESIZE); hitBounds = bounds; } ////// /// Very simple paint logic. /// public override void Paint(PaintEventArgs pe) { DesignerUtils.DrawNoResizeHandle(pe.Graphics, bounds, isPrimary, this); } } } // 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
- Point3DCollectionValueSerializer.cs
- SoapRpcServiceAttribute.cs
- Int32AnimationUsingKeyFrames.cs
- LayoutInformation.cs
- grammarelement.cs
- DataQuery.cs
- BamlRecordWriter.cs
- ClrProviderManifest.cs
- HttpProcessUtility.cs
- SortQuery.cs
- OrderPreservingPipeliningSpoolingTask.cs
- RuntimeEnvironment.cs
- OneOfTypeConst.cs
- DataPagerField.cs
- AssemblyBuilder.cs
- WorkflowMessageEventHandler.cs
- VirtualizingStackPanel.cs
- TextEffect.cs
- CompatibleIComparer.cs
- StaticTextPointer.cs
- UserNameSecurityToken.cs
- LogRecordSequence.cs
- QueueProcessor.cs
- CheckBox.cs
- StateMachine.cs
- XmlSchemaObjectTable.cs
- SyndicationDeserializer.cs
- FlowDocumentView.cs
- TemplatePagerField.cs
- ByteAnimationBase.cs
- QueryOpcode.cs
- AxisAngleRotation3D.cs
- MetadataItemSerializer.cs
- ISAPIWorkerRequest.cs
- DataGridState.cs
- ConfigurationElementCollection.cs
- SpecularMaterial.cs
- MultiPageTextView.cs
- ExitEventArgs.cs
- MouseWheelEventArgs.cs
- ThreadAttributes.cs
- Transform.cs
- RoutedEventArgs.cs
- KeyboardEventArgs.cs
- SqlMethods.cs
- Attributes.cs
- MemberMaps.cs
- AnonymousIdentificationSection.cs
- Polygon.cs
- BitmapImage.cs
- ReleaseInstanceMode.cs
- ThreadAttributes.cs
- KeyedHashAlgorithm.cs
- MostlySingletonList.cs
- UniqueIdentifierService.cs
- StylusPlugin.cs
- CookielessHelper.cs
- TabControlCancelEvent.cs
- RankException.cs
- DataSpaceManager.cs
- IntSecurity.cs
- WpfSharedBamlSchemaContext.cs
- CharEnumerator.cs
- QilGenerator.cs
- XslUrlEditor.cs
- DataGridGeneralPage.cs
- SmtpNetworkElement.cs
- BinaryObjectWriter.cs
- ButtonBase.cs
- CategoryAttribute.cs
- followingsibling.cs
- ElementsClipboardData.cs
- ActivityExecutor.cs
- AnimatedTypeHelpers.cs
- ConstraintStruct.cs
- StateWorkerRequest.cs
- FreezableCollection.cs
- PageStatePersister.cs
- CroppedBitmap.cs
- TemplateInstanceAttribute.cs
- ElementUtil.cs
- AsymmetricSecurityProtocolFactory.cs
- Invariant.cs
- InputMethodStateChangeEventArgs.cs
- DisposableCollectionWrapper.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Hashtable.cs
- MetadataArtifactLoader.cs
- OutOfMemoryException.cs
- CodeArrayIndexerExpression.cs
- WindowsContainer.cs
- ReadOnlyTernaryTree.cs
- ListView.cs
- MenuItemStyle.cs
- ConfigurationErrorsException.cs
- WindowsListView.cs
- x509utils.cs
- ReachFixedPageSerializerAsync.cs
- SafeRegistryHandle.cs
- XmlDownloadManager.cs