Code:
/ DotNET / DotNET / 8.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
- CommonProperties.cs
- MachineKeySection.cs
- BevelBitmapEffect.cs
- PointKeyFrameCollection.cs
- XmlElementElement.cs
- ToolStripOverflow.cs
- NamespaceList.cs
- IDictionary.cs
- OleDbPropertySetGuid.cs
- xamlnodes.cs
- Localizer.cs
- Bookmark.cs
- StylusDevice.cs
- GridLengthConverter.cs
- UnicastIPAddressInformationCollection.cs
- RenderDataDrawingContext.cs
- XmlSchemaInfo.cs
- CSharpCodeProvider.cs
- Icon.cs
- Parser.cs
- TextPointer.cs
- InfoCardListRequest.cs
- CodeCatchClause.cs
- DataGridViewColumnConverter.cs
- Relationship.cs
- BaseCAMarshaler.cs
- PerformanceCounterManager.cs
- FontDifferentiator.cs
- PolicyManager.cs
- MSHTMLHostUtil.cs
- CallInfo.cs
- TabControlCancelEvent.cs
- BackStopAuthenticationModule.cs
- LinqToSqlWrapper.cs
- SafePointer.cs
- ZipIOExtraFieldZip64Element.cs
- XmlBaseWriter.cs
- NumericUpDownAcceleration.cs
- HealthMonitoringSectionHelper.cs
- CharConverter.cs
- ZipIOLocalFileBlock.cs
- File.cs
- ConfigurationValues.cs
- WebPartMenu.cs
- DesignerOptionService.cs
- SingleConverter.cs
- FormViewPageEventArgs.cs
- CapabilitiesAssignment.cs
- ListBindingConverter.cs
- HtmlTable.cs
- MemberPath.cs
- ISAPIWorkerRequest.cs
- SourceFileInfo.cs
- DataBindingCollection.cs
- WorkerRequest.cs
- RegexCompilationInfo.cs
- PathNode.cs
- ActivityCodeDomReferenceService.cs
- SectionXmlInfo.cs
- Interop.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- ValidationRuleCollection.cs
- SafeNativeMethodsMilCoreApi.cs
- Compiler.cs
- WebServiceHandler.cs
- CharacterShapingProperties.cs
- NumberFormatInfo.cs
- VisualBasicSettingsConverter.cs
- NumericUpDownAccelerationCollection.cs
- GacUtil.cs
- FrameworkElementFactory.cs
- GetLastErrorDetailsRequest.cs
- GlobalProxySelection.cs
- HandleExceptionArgs.cs
- CodeTypeParameterCollection.cs
- GroupItem.cs
- DictionaryEntry.cs
- DbCommandDefinition.cs
- BlurEffect.cs
- TextFragmentEngine.cs
- X509CertificateStore.cs
- RenderData.cs
- SystemIPv6InterfaceProperties.cs
- OrthographicCamera.cs
- DataSourceControl.cs
- Version.cs
- SystemTcpStatistics.cs
- BitmapEffectCollection.cs
- XpsTokenContext.cs
- FixUpCollection.cs
- XsltArgumentList.cs
- ButtonColumn.cs
- ListMarkerLine.cs
- odbcmetadatacolumnnames.cs
- ToolBar.cs
- WindowsGraphics2.cs
- ImageFormat.cs
- MultiPropertyDescriptorGridEntry.cs
- GlyphElement.cs
- PerformanceCounterManager.cs