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
- Run.cs
- IsolatedStorageFileStream.cs
- XamlGridLengthSerializer.cs
- WeakReferenceEnumerator.cs
- UncommonField.cs
- ModifyActivitiesPropertyDescriptor.cs
- LockRecursionException.cs
- ProfileSection.cs
- OracleDataReader.cs
- LogRestartAreaEnumerator.cs
- CriticalFinalizerObject.cs
- AddInStore.cs
- InvokeProviderWrapper.cs
- ApplicationInterop.cs
- AttributeUsageAttribute.cs
- UrlPath.cs
- APCustomTypeDescriptor.cs
- OleDbConnectionFactory.cs
- TextRangeAdaptor.cs
- HelpExampleGenerator.cs
- SerializationSectionGroup.cs
- SequentialUshortCollection.cs
- X509Certificate2Collection.cs
- HTMLTagNameToTypeMapper.cs
- TrackingServices.cs
- ObjectAnimationBase.cs
- Panel.cs
- WaitForChangedResult.cs
- BufferModesCollection.cs
- ArrayList.cs
- BindingListCollectionView.cs
- OutputScopeManager.cs
- IsolationInterop.cs
- CodeAttributeDeclarationCollection.cs
- StringSorter.cs
- PerformanceCounterLib.cs
- TdsRecordBufferSetter.cs
- SQLMoneyStorage.cs
- UnsafeNativeMethods.cs
- DetailsViewDeletedEventArgs.cs
- diagnosticsswitches.cs
- ConditionalAttribute.cs
- WindowsTooltip.cs
- ToolboxItem.cs
- LineServicesRun.cs
- GifBitmapDecoder.cs
- WindowsEditBoxRange.cs
- FixedSOMPageConstructor.cs
- XamlToRtfWriter.cs
- ProfileProvider.cs
- CustomErrorCollection.cs
- ContextMenu.cs
- UriScheme.cs
- CleanUpVirtualizedItemEventArgs.cs
- SchemaNamespaceManager.cs
- DataControlImageButton.cs
- GregorianCalendarHelper.cs
- EditableLabelControl.cs
- AttributeCollection.cs
- TagNameToTypeMapper.cs
- IgnoreSection.cs
- ToolboxItemAttribute.cs
- ConstructorExpr.cs
- NegotiationTokenAuthenticatorStateCache.cs
- ProvideValueServiceProvider.cs
- FilterEventArgs.cs
- GridToolTip.cs
- ProbeRequestResponseAsyncResult.cs
- SplashScreen.cs
- Memoizer.cs
- FormViewDeletedEventArgs.cs
- FileUtil.cs
- ModelItemDictionaryImpl.cs
- DetailsViewModeEventArgs.cs
- DrawingImage.cs
- DataGridViewRowCollection.cs
- SyndicationSerializer.cs
- TraceFilter.cs
- ScriptHandlerFactory.cs
- Attributes.cs
- ConnectionConsumerAttribute.cs
- SqlTrackingWorkflowInstance.cs
- ValidationError.cs
- ReadOnlyDataSource.cs
- Binding.cs
- SizeConverter.cs
- TrackingMemoryStreamFactory.cs
- NoneExcludedImageIndexConverter.cs
- ReadOnlyDictionary.cs
- CacheChildrenQuery.cs
- COM2AboutBoxPropertyDescriptor.cs
- FocusTracker.cs
- UrlPath.cs
- SerTrace.cs
- SystemIPInterfaceProperties.cs
- DesignerActionService.cs
- ComboBoxRenderer.cs
- Brush.cs
- ObjectHandle.cs
- WebBrowserSiteBase.cs