Code:
/ DotNET / DotNET / 8.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
- XmlSchemaAll.cs
- ObjectDataSourceFilteringEventArgs.cs
- CodeEntryPointMethod.cs
- XmlSchemaAttributeGroup.cs
- HttpStaticObjectsCollectionBase.cs
- LeafCellTreeNode.cs
- CSharpCodeProvider.cs
- StreamWithDictionary.cs
- DmlSqlGenerator.cs
- COM2Enum.cs
- HttpWrapper.cs
- WebExceptionStatus.cs
- StateFinalizationActivity.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- HitTestDrawingContextWalker.cs
- Serializer.cs
- EdmSchemaAttribute.cs
- _NetworkingPerfCounters.cs
- MethodRental.cs
- WebPartAddingEventArgs.cs
- RegexWorker.cs
- InternalDispatchObject.cs
- PersonalizationStateQuery.cs
- BitmapImage.cs
- GeneralTransformGroup.cs
- ScrollBarAutomationPeer.cs
- DebugHandleTracker.cs
- SqlMethodAttribute.cs
- CheckPair.cs
- SqlSupersetValidator.cs
- TableAdapterManagerHelper.cs
- behaviorssection.cs
- InternalPolicyElement.cs
- ListBoxAutomationPeer.cs
- AtomEntry.cs
- VerificationException.cs
- XhtmlBasicPageAdapter.cs
- PageContent.cs
- GridViewCommandEventArgs.cs
- MsmqIntegrationSecurityMode.cs
- DocumentAutomationPeer.cs
- AnnouncementEventArgs.cs
- FixedStringLookup.cs
- CreateRefExpr.cs
- DataDocumentXPathNavigator.cs
- DockPattern.cs
- ScrollItemProviderWrapper.cs
- DataGridViewComboBoxCell.cs
- InkPresenterAutomationPeer.cs
- TokenBasedSetEnumerator.cs
- Soap11ServerProtocol.cs
- ComboBoxRenderer.cs
- ChooseAction.cs
- XamlPointCollectionSerializer.cs
- UpdateManifestForBrowserApplication.cs
- ToolStripButton.cs
- WebPartsPersonalizationAuthorization.cs
- ManualWorkflowSchedulerService.cs
- Polyline.cs
- StringAnimationUsingKeyFrames.cs
- ItemAutomationPeer.cs
- DocumentSequence.cs
- InternalControlCollection.cs
- WebPartHelpVerb.cs
- OwnerDrawPropertyBag.cs
- PipeConnection.cs
- XmlDataLoader.cs
- ProcessHostConfigUtils.cs
- SessionPageStateSection.cs
- InsufficientMemoryException.cs
- XmlUnspecifiedAttribute.cs
- ValidationHelper.cs
- WebServicesDescriptionAttribute.cs
- UdpDiscoveryEndpoint.cs
- XmlCharacterData.cs
- MessagingDescriptionAttribute.cs
- XamlSerializerUtil.cs
- PeerCollaboration.cs
- TextBox.cs
- TextRangeEdit.cs
- DelegateInArgument.cs
- HotSpot.cs
- SqlConnectionFactory.cs
- DataError.cs
- UidPropertyAttribute.cs
- SoapMessage.cs
- storagemappingitemcollection.viewdictionary.cs
- PrimitiveXmlSerializers.cs
- WebResourceAttribute.cs
- ModuleBuilderData.cs
- WsdlExporter.cs
- XhtmlTextWriter.cs
- ObjectDataSourceMethodEventArgs.cs
- DependencyObject.cs
- AdRotatorDesigner.cs
- SymbolMethod.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- MultipartContentParser.cs
- BamlRecordReader.cs
- MetafileHeader.cs