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
- SubMenuStyle.cs
- DateTimeFormat.cs
- HashSet.cs
- XmlValidatingReader.cs
- WebPartEditorApplyVerb.cs
- Evaluator.cs
- EntityContainerEntitySet.cs
- InputMethod.cs
- IInstanceContextProvider.cs
- DataGridViewRowPostPaintEventArgs.cs
- RelationshipConverter.cs
- WorkflowRuntime.cs
- StrokeCollectionDefaultValueFactory.cs
- Sentence.cs
- CustomWebEventKey.cs
- PolyQuadraticBezierSegment.cs
- StylusButtonCollection.cs
- PageThemeCodeDomTreeGenerator.cs
- HttpListenerRequestTraceRecord.cs
- ADRoleFactory.cs
- ArgumentNullException.cs
- Compress.cs
- ContentType.cs
- DetailsViewUpdatedEventArgs.cs
- SimpleLine.cs
- EnumValidator.cs
- DPTypeDescriptorContext.cs
- SrgsElementFactory.cs
- TTSVoice.cs
- HtmlInputCheckBox.cs
- controlskin.cs
- QilInvoke.cs
- DBSqlParserTable.cs
- Queue.cs
- IdentityManager.cs
- sqlstateclientmanager.cs
- SchemaTableOptionalColumn.cs
- LicFileLicenseProvider.cs
- BindingListCollectionView.cs
- WCFServiceClientProxyGenerator.cs
- TextParaClient.cs
- HtmlTitle.cs
- SessionStateItemCollection.cs
- SchemaImporterExtensionElement.cs
- OutputCacheProfileCollection.cs
- BooleanToVisibilityConverter.cs
- NetStream.cs
- StateItem.cs
- DescendantQuery.cs
- FontCacheLogic.cs
- FamilyTypeface.cs
- Assert.cs
- DoubleLinkListEnumerator.cs
- FileDialogCustomPlace.cs
- FrameworkPropertyMetadata.cs
- UpdateManifestForBrowserApplication.cs
- DataObjectSettingDataEventArgs.cs
- DataSourceControl.cs
- ApplicationDirectory.cs
- XslNumber.cs
- HttpListenerPrefixCollection.cs
- SecurityTokenTypes.cs
- ButtonField.cs
- TemplateField.cs
- ManipulationPivot.cs
- JsonObjectDataContract.cs
- Domain.cs
- UIElement3D.cs
- FontStretch.cs
- DesignerSerializationVisibilityAttribute.cs
- XmlSchemaDatatype.cs
- ManagementObject.cs
- TypeListConverter.cs
- SessionSwitchEventArgs.cs
- WindowsMenu.cs
- Crc32.cs
- SectionXmlInfo.cs
- IDQuery.cs
- Enlistment.cs
- GridViewRowPresenterBase.cs
- ShadowGlyph.cs
- DivideByZeroException.cs
- ProxyAttribute.cs
- Bits.cs
- ReliabilityContractAttribute.cs
- Mapping.cs
- XmlILIndex.cs
- WindowsGraphicsWrapper.cs
- DeferredReference.cs
- ObjectDisposedException.cs
- LinkedList.cs
- XPathParser.cs
- AttributeData.cs
- ApplicationTrust.cs
- AmbientLight.cs
- SubtreeProcessor.cs
- DBSqlParser.cs
- RequestCache.cs
- ChangeNode.cs
- HybridDictionary.cs