Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonPopupAdapter.cs / 1305376 / RadioButtonPopupAdapter.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 RadioButtonPopupAdapter : RadioButtonFlatAdapter { internal RadioButtonPopupAdapter(ButtonBase control) : base(control) {} internal override void PaintUp(PaintEventArgs e, CheckState state) { System.Drawing.Graphics g = e.Graphics; if (Control.Appearance == Appearance.Button) { ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control); adapter.PaintUp(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintPopupRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBackgroundFlat(e, layout.checkBounds, colors.buttonShadow, colors.options.highContrast ? colors.buttonFace : colors.highlight, true); DrawCheckOnly(e, layout, colors.windowText, colors.highlight, true); PaintField(e, layout, colors, colors.windowText, true); } } internal override void PaintOver(PaintEventArgs e, CheckState state) { System.Drawing.Graphics g = e.Graphics; if (Control.Appearance == Appearance.Button) { ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control); adapter.PaintOver(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintPopupRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBackground3DLite(e, layout.checkBounds, colors.windowText, colors.options.highContrast ? colors.buttonFace : colors.highlight, colors, true); DrawCheckOnly(e, layout, colors.windowText, colors.highlight, true); PaintField(e, layout, colors, colors.windowText, true); } } internal override void PaintDown(PaintEventArgs e, CheckState state) { System.Drawing.Graphics g = e.Graphics; if (Control.Appearance == Appearance.Button) { ButtonPopupAdapter adapter = new ButtonPopupAdapter(Control); adapter.PaintDown(e, Control.Checked ? CheckState.Checked : CheckState.Unchecked); } else { ColorData colors = PaintPopupRender(e.Graphics).Calculate(); LayoutData layout = Layout(e).Layout(); PaintButtonBackground(e, Control.ClientRectangle, null); PaintImage(e, layout); DrawCheckBackground3DLite(e, layout.checkBounds, colors.windowText, colors.highlight, colors, true); DrawCheckOnly(e, layout, colors.buttonShadow, colors.highlight, true); PaintField(e, layout, colors, colors.windowText, true); } } #region Layout protected override ButtonBaseAdapter CreateButtonAdapter() { return new ButtonPopupAdapter(Control); } protected override LayoutOptions Layout(PaintEventArgs e) { LayoutOptions layout = base.Layout(e); if (!Control.MouseIsDown && !Control.MouseIsOver) { layout.shadowedText = true; } 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
- MultiSelectRootGridEntry.cs
- safesecurityhelperavalon.cs
- x509utils.cs
- RequestContextBase.cs
- IntPtr.cs
- ItemContainerGenerator.cs
- TableColumn.cs
- ListViewSelectEventArgs.cs
- ProcessHostFactoryHelper.cs
- AdPostCacheSubstitution.cs
- FragmentQuery.cs
- WindowsListViewGroupSubsetLink.cs
- FormViewRow.cs
- ComIntegrationManifestGenerator.cs
- Vector3DCollectionConverter.cs
- GradientStopCollection.cs
- ComboBox.cs
- TransactionFilter.cs
- Base64Encoder.cs
- UnsafeNativeMethods.cs
- FileLoadException.cs
- ComboBoxRenderer.cs
- Animatable.cs
- SqlClientWrapperSmiStream.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- JumpItem.cs
- ProtocolsInstallComponent.cs
- WindowsPrincipal.cs
- ButtonBaseAutomationPeer.cs
- TextBoxDesigner.cs
- XsdBuildProvider.cs
- Parameter.cs
- PartitionerQueryOperator.cs
- XmlResolver.cs
- ResourceDescriptionAttribute.cs
- DiscoveryServiceExtension.cs
- StylusDownEventArgs.cs
- NameTable.cs
- ActivityBuilderHelper.cs
- XmlAttribute.cs
- X509ChainPolicy.cs
- XamlVector3DCollectionSerializer.cs
- followingsibling.cs
- DeflateStream.cs
- WindowsListViewItemCheckBox.cs
- TextRunProperties.cs
- TextElementAutomationPeer.cs
- NaturalLanguageHyphenator.cs
- ExtensionFile.cs
- CredentialCache.cs
- XmlSchemaDatatype.cs
- MissingFieldException.cs
- ToolStripPanelSelectionGlyph.cs
- SplitterPanel.cs
- XmlValidatingReaderImpl.cs
- BinaryWriter.cs
- RefreshInfo.cs
- DashStyle.cs
- RTLAwareMessageBox.cs
- XsltArgumentList.cs
- SqlDataSourceCommandEventArgs.cs
- DisplayInformation.cs
- ListControl.cs
- SiteMapDataSource.cs
- ThreadExceptionDialog.cs
- Pool.cs
- Line.cs
- ArrowControl.xaml.cs
- NameTable.cs
- ExpressionParser.cs
- ResourceExpressionBuilder.cs
- WebPartDisplayModeCollection.cs
- Msmq4PoisonHandler.cs
- UnsafeNativeMethods.cs
- ErrorTableItemStyle.cs
- BindingContext.cs
- UrlMapping.cs
- Math.cs
- PageParserFilter.cs
- XmlWrappingReader.cs
- FilterableAttribute.cs
- BindingValueChangedEventArgs.cs
- SqlComparer.cs
- ColumnClickEvent.cs
- WebBrowserBase.cs
- SoapReflector.cs
- SaveWorkflowAsyncResult.cs
- MatrixTransform.cs
- versioninfo.cs
- EventManager.cs
- Viewport3DAutomationPeer.cs
- TreeNodeStyleCollection.cs
- Misc.cs
- TextSimpleMarkerProperties.cs
- DataServiceQueryProvider.cs
- TogglePattern.cs
- DesignerActionService.cs
- ConnectivityStatus.cs
- LineMetrics.cs
- FrugalList.cs