Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonStandardAdapter.cs / 1305376 / 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; } } // Dev10 bug 525537 else { layout.checkSize = (int)(layout.checkSize * GetDpiScaleRatio(e.Graphics)); } return layout; } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ExpressionHelper.cs
- AsymmetricKeyExchangeFormatter.cs
- UnsafeNativeMethods.cs
- ByteConverter.cs
- DataGridPageChangedEventArgs.cs
- NetworkCredential.cs
- SoundPlayerAction.cs
- TemplateBaseAction.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DataGridViewTopRowAccessibleObject.cs
- WriteFileContext.cs
- _DisconnectOverlappedAsyncResult.cs
- ConfigurationSchemaErrors.cs
- Logging.cs
- PropertyMapper.cs
- Selection.cs
- Evidence.cs
- SmtpSection.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- GroupBoxRenderer.cs
- GeneralTransform3DGroup.cs
- TabItem.cs
- Processor.cs
- Enlistment.cs
- SerializationFieldInfo.cs
- GlyphCache.cs
- XmlTextReader.cs
- PrintDocument.cs
- SessionStateModule.cs
- SmiEventSink.cs
- ConnectionPoint.cs
- Point3DAnimation.cs
- DockAndAnchorLayout.cs
- SqlGenericUtil.cs
- OutputScopeManager.cs
- ScrollItemPattern.cs
- OpacityConverter.cs
- XmlChildEnumerator.cs
- MenuCommand.cs
- MetadataItem.cs
- AppLevelCompilationSectionCache.cs
- StsCommunicationException.cs
- RowToParametersTransformer.cs
- SystemIPGlobalProperties.cs
- ExtensionMethods.cs
- ConfigurationSectionGroupCollection.cs
- PasswordTextContainer.cs
- AmbientLight.cs
- CodeMemberMethod.cs
- RSACryptoServiceProvider.cs
- SqlIdentifier.cs
- ClusterRegistryConfigurationProvider.cs
- ObjectReaderCompiler.cs
- LinkedList.cs
- HitTestWithPointDrawingContextWalker.cs
- SelectionItemProviderWrapper.cs
- DefaultValueTypeConverter.cs
- Marshal.cs
- updatecommandorderer.cs
- DataServices.cs
- WeakEventTable.cs
- PreloadedPackages.cs
- IIS7UserPrincipal.cs
- CacheEntry.cs
- DomNameTable.cs
- ToolStripPanelCell.cs
- SizeF.cs
- WebBrowserDocumentCompletedEventHandler.cs
- StatusInfoItem.cs
- ConfigurationElement.cs
- InputEventArgs.cs
- ValidatorCompatibilityHelper.cs
- CommunicationObject.cs
- DataGridTable.cs
- BasicKeyConstraint.cs
- Action.cs
- FrameworkRichTextComposition.cs
- ArgIterator.cs
- ValidatorCompatibilityHelper.cs
- MapPathBasedVirtualPathProvider.cs
- UrlAuthFailedErrorFormatter.cs
- TraceLevelHelper.cs
- RectIndependentAnimationStorage.cs
- EndPoint.cs
- PropertyGeneratedEventArgs.cs
- HttpHandlerActionCollection.cs
- MediaScriptCommandRoutedEventArgs.cs
- OdbcUtils.cs
- querybuilder.cs
- SqlRowUpdatedEvent.cs
- Thumb.cs
- RadioButton.cs
- objectresult_tresulttype.cs
- WinInetCache.cs
- _DomainName.cs
- ToolStripSeparatorRenderEventArgs.cs
- SQLBytes.cs
- MemoryMappedFileSecurity.cs
- MimeWriter.cs
- XmlIlGenerator.cs