Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonStandardAdapter.cs / 1 / RadioButtonStandardAdapter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Windows.Forms.ButtonInternal { using System; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Text; using System.Windows.Forms; internal class RadioButtonStandardAdapter : RadioButtonBaseAdapter { internal RadioButtonStandardAdapter(ButtonBase control) : base(control) {} internal override void PaintUp(PaintEventArgs e, CheckState state) { if (Control.Appearance == Appearance.Button) { ButtonAdapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBox(e, layout); PaintField(e, layout, colors, colors.windowText, true); } } internal override void PaintDown(PaintEventArgs e, CheckState state) { if (Control.Appearance == Appearance.Button) { ButtonAdapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { PaintUp(e, state); } } internal override void PaintOver(PaintEventArgs e, CheckState state) { if (Control.Appearance == Appearance.Button) { ButtonAdapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { PaintUp(e, state); } } private new ButtonStandardAdapter ButtonAdapter { get { return ((ButtonStandardAdapter)base.ButtonAdapter); } } protected override ButtonBaseAdapter CreateButtonAdapter() { return new ButtonStandardAdapter(Control); } #region Temp protected override LayoutOptions Layout(PaintEventArgs e) { LayoutOptions layout = CommonLayout(); layout.hintTextUp = false; layout.everettButtonCompat = !Application.RenderWithVisualStyles; // VSWhidbey 420870 if (Application.RenderWithVisualStyles) { using (Graphics g = WindowsFormsUtils.CreateMeasurementGraphics()) { layout.checkSize = RadioButtonRenderer.GetGlyphSize(g, RadioButtonRenderer.ConvertFromButtonState(GetState(), Control.MouseIsOver)).Width; } } return layout; } #endregion } } // 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
- ByteStreamMessageEncodingElement.cs
- BitStack.cs
- SendMailErrorEventArgs.cs
- ConfigDefinitionUpdates.cs
- OutputCache.cs
- HttpInputStream.cs
- DefaultSettingsSection.cs
- VirtualDirectoryMappingCollection.cs
- XmlSchemaGroup.cs
- Delay.cs
- BufferBuilder.cs
- unsafenativemethodsother.cs
- ParameterBuilder.cs
- BinHexEncoding.cs
- LogExtentCollection.cs
- PermissionSetEnumerator.cs
- GridEntryCollection.cs
- XmlIlVisitor.cs
- SelectionRange.cs
- IndicCharClassifier.cs
- BrowserCapabilitiesFactory.cs
- FileEnumerator.cs
- QueryConverter.cs
- CodeTypeParameterCollection.cs
- FontDriver.cs
- BaseTransportHeaders.cs
- SharedMemory.cs
- SingleKeyFrameCollection.cs
- ObjectItemCollection.cs
- DocumentOrderQuery.cs
- METAHEADER.cs
- DesigntimeLicenseContextSerializer.cs
- Exceptions.cs
- DependencyPropertyChangedEventArgs.cs
- XmlCharCheckingReader.cs
- DeferredRunTextReference.cs
- SendReply.cs
- LostFocusEventManager.cs
- Axis.cs
- XmlQualifiedName.cs
- _TLSstream.cs
- StreamInfo.cs
- Assembly.cs
- SoapRpcMethodAttribute.cs
- PasswordPropertyTextAttribute.cs
- TypeDelegator.cs
- HScrollProperties.cs
- CacheSection.cs
- MonitorWrapper.cs
- HttpProfileBase.cs
- PeerName.cs
- X509KeyIdentifierClauseType.cs
- AmbientValueAttribute.cs
- PerformanceCounterPermission.cs
- XmlChoiceIdentifierAttribute.cs
- DiscoveryCallbackBehavior.cs
- MailWebEventProvider.cs
- ForeignKeyConstraint.cs
- BitmapFrameEncode.cs
- Expression.cs
- ChooseAction.cs
- DesignerMetadata.cs
- ExtensibleClassFactory.cs
- DataGridState.cs
- ProviderCommandInfoUtils.cs
- TextServicesCompartment.cs
- StatusBarAutomationPeer.cs
- DateTimeConverter2.cs
- PartialToken.cs
- propertyentry.cs
- PathFigureCollection.cs
- MethodBuilder.cs
- MenuItem.cs
- DesignerLoader.cs
- FilterQuery.cs
- PropertyRef.cs
- CrossAppDomainChannel.cs
- ResizeGrip.cs
- OletxResourceManager.cs
- CompModSwitches.cs
- EdmMember.cs
- TableTextElementCollectionInternal.cs
- TrackingDataItemValue.cs
- SchemaImporterExtensionElement.cs
- BamlLocalizationDictionary.cs
- CellParaClient.cs
- SelectionChangedEventArgs.cs
- PeerApplicationLaunchInfo.cs
- LassoHelper.cs
- ReflectionPermission.cs
- SafeProcessHandle.cs
- ImageFormatConverter.cs
- MsmqBindingElementBase.cs
- CacheVirtualItemsEvent.cs
- ButtonStandardAdapter.cs
- ReadOnlyAttribute.cs
- AuthenticationService.cs
- MessageQueueEnumerator.cs
- AffineTransform3D.cs
- _LazyAsyncResult.cs