Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonPopupAdapter.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BrowserDefinitionCollection.cs
- SHA1.cs
- DynamicPropertyHolder.cs
- Utilities.cs
- ReachPageContentSerializerAsync.cs
- ServerProtocol.cs
- SystemException.cs
- NamedPermissionSet.cs
- DesignTimeType.cs
- SQLDoubleStorage.cs
- MultiBindingExpression.cs
- ArgumentException.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- ISO2022Encoding.cs
- BindingManagerDataErrorEventArgs.cs
- XmlNodeReader.cs
- Image.cs
- WindowsFormsHost.cs
- CustomGrammar.cs
- Simplifier.cs
- CqlParser.cs
- SchemaType.cs
- ToolboxItemAttribute.cs
- AnnotationResourceChangedEventArgs.cs
- ConfigurationStrings.cs
- VirtualDirectoryMapping.cs
- Sentence.cs
- XmlCharacterData.cs
- QuaternionConverter.cs
- ChannelSettingsElement.cs
- XmlHierarchyData.cs
- DataGridViewBand.cs
- ElementAction.cs
- Triplet.cs
- TextAction.cs
- FileBasedResourceGroveler.cs
- HttpHandlersInstallComponent.cs
- WebBrowserDocumentCompletedEventHandler.cs
- BCryptHashAlgorithm.cs
- XmlSchemaSequence.cs
- DBBindings.cs
- ProjectionCamera.cs
- FlowchartStart.xaml.cs
- InvalidPropValue.cs
- SymDocumentType.cs
- designeractionlistschangedeventargs.cs
- PeerPresenceInfo.cs
- SecurityUtils.cs
- QilExpression.cs
- Double.cs
- CategoriesDocumentFormatter.cs
- EntityFrameworkVersions.cs
- StatusCommandUI.cs
- DispatchChannelSink.cs
- PropertyPath.cs
- ObjectIDGenerator.cs
- HttpResponse.cs
- Pen.cs
- NumberAction.cs
- TypedTableBaseExtensions.cs
- RadioButton.cs
- SQLMoney.cs
- DATA_BLOB.cs
- ServiceEndpointElementCollection.cs
- MultiDataTrigger.cs
- PropertyIDSet.cs
- ComponentRenameEvent.cs
- ZipPackage.cs
- ColorContext.cs
- HandlerMappingMemo.cs
- TypedTableBaseExtensions.cs
- SmiSettersStream.cs
- DataBindingsDialog.cs
- ToolboxItemCollection.cs
- SqlVersion.cs
- TextTrailingWordEllipsis.cs
- MatrixTransform.cs
- AdornerLayer.cs
- Processor.cs
- ManagementExtension.cs
- XmlCharCheckingWriter.cs
- ElementUtil.cs
- TPLETWProvider.cs
- PreparingEnlistment.cs
- WorkflowInstanceTerminatedRecord.cs
- SourceInterpreter.cs
- EllipseGeometry.cs
- TextEditorThreadLocalStore.cs
- Tuple.cs
- EngineSite.cs
- PreviewPageInfo.cs
- XmlSignificantWhitespace.cs
- lengthconverter.cs
- wgx_commands.cs
- AttributeSetAction.cs
- OutKeywords.cs
- XamlWrapperReaders.cs
- BamlLocalizableResourceKey.cs
- ArrayEditor.cs
- Unit.cs