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
- _SslSessionsCache.cs
- XmlQueryType.cs
- HtmlLabelAdapter.cs
- DeviceFilterEditorDialog.cs
- DrawingServices.cs
- HttpCachePolicyElement.cs
- Utils.cs
- HotSpot.cs
- ConcurrencyBehavior.cs
- KeyManager.cs
- ComponentResourceKeyConverter.cs
- ContentValidator.cs
- DataGridViewRowPrePaintEventArgs.cs
- TogglePatternIdentifiers.cs
- TypeForwardedFromAttribute.cs
- HebrewCalendar.cs
- Deserializer.cs
- BaseInfoTable.cs
- EmptyElement.cs
- DataGridViewTopRowAccessibleObject.cs
- HttpListener.cs
- BindingNavigator.cs
- SafeProcessHandle.cs
- FieldNameLookup.cs
- CatalogPartCollection.cs
- InstanceHandleReference.cs
- CodeAttributeDeclarationCollection.cs
- _Semaphore.cs
- HttpCachePolicyElement.cs
- ActiveXContainer.cs
- DiagnosticStrings.cs
- DataTableMapping.cs
- WmpBitmapEncoder.cs
- Page.cs
- ReaderOutput.cs
- DesignTimeParseData.cs
- DragDrop.cs
- CopyOnWriteList.cs
- ContextMenuStrip.cs
- TextServicesDisplayAttributePropertyRanges.cs
- BoundsDrawingContextWalker.cs
- Rect3DConverter.cs
- XslCompiledTransform.cs
- _BaseOverlappedAsyncResult.cs
- DataGridComponentEditor.cs
- ClientSponsor.cs
- TextRangeEditLists.cs
- AndMessageFilter.cs
- MatrixTransform.cs
- ContentElement.cs
- UpdateCompiler.cs
- FileIOPermission.cs
- WizardStepCollectionEditor.cs
- PathGradientBrush.cs
- AncestorChangedEventArgs.cs
- PageEventArgs.cs
- SequentialWorkflowRootDesigner.cs
- LineInfo.cs
- PageVisual.cs
- BCLDebug.cs
- UserNamePasswordValidator.cs
- UriSection.cs
- TargetException.cs
- WebPartManagerInternals.cs
- GlyphShapingProperties.cs
- StrokeNodeOperations.cs
- DbTransaction.cs
- MembershipSection.cs
- MenuItemBindingCollection.cs
- MergeFailedEvent.cs
- MailMessageEventArgs.cs
- SqlMethodAttribute.cs
- StylusCaptureWithinProperty.cs
- SafeRsaProviderHandle.cs
- TabControlAutomationPeer.cs
- SkipQueryOptionExpression.cs
- CompiledAction.cs
- XmlSiteMapProvider.cs
- DiagnosticsConfigurationHandler.cs
- ActivityDesignerLayoutSerializers.cs
- UmAlQuraCalendar.cs
- RuleEngine.cs
- Pair.cs
- DataExpression.cs
- FormatConvertedBitmap.cs
- TextServicesDisplayAttribute.cs
- DefaultHttpHandler.cs
- ActivityMarkupSerializer.cs
- TabPanel.cs
- DropAnimation.xaml.cs
- HierarchicalDataSourceDesigner.cs
- RenamedEventArgs.cs
- AuthorizationSection.cs
- OrderedDictionaryStateHelper.cs
- DataGridItem.cs
- ColorPalette.cs
- DesignerDataView.cs
- FederatedMessageSecurityOverHttpElement.cs
- LockRecursionException.cs
- BinarySerializer.cs