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
- UnsafeNativeMethods.cs
- ConnectionStringsSection.cs
- GetPageCompletedEventArgs.cs
- ComponentChangingEvent.cs
- RawContentTypeMapper.cs
- MimeMapping.cs
- NativeRightsManagementAPIsStructures.cs
- PathFigureCollectionValueSerializer.cs
- COM2EnumConverter.cs
- Schema.cs
- GAC.cs
- MailMessage.cs
- ToolboxItemCollection.cs
- Helpers.cs
- NumericUpDown.cs
- RectAnimationUsingKeyFrames.cs
- RoleGroup.cs
- GeometryValueSerializer.cs
- Span.cs
- ObservableDictionary.cs
- XmlCharCheckingReader.cs
- DataGridBoolColumn.cs
- handlecollector.cs
- ConnectionPoolManager.cs
- OdbcConnectionString.cs
- Point.cs
- Hash.cs
- RequestTimeoutManager.cs
- XmlSortKeyAccumulator.cs
- SyntaxCheck.cs
- InputDevice.cs
- AutomationPeer.cs
- SerialStream.cs
- RoleManagerEventArgs.cs
- RequestStatusBarUpdateEventArgs.cs
- OpenFileDialog.cs
- FrameworkPropertyMetadata.cs
- Shape.cs
- WindowsRegion.cs
- _HeaderInfoTable.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Point3DAnimationUsingKeyFrames.cs
- SubMenuStyle.cs
- MessageBox.cs
- Image.cs
- elementinformation.cs
- JsonUriDataContract.cs
- PopupRoot.cs
- Schema.cs
- SkewTransform.cs
- FloaterBaseParagraph.cs
- PropertyEmitterBase.cs
- MenuStrip.cs
- CodeDomLocalizationProvider.cs
- ConfigurationStrings.cs
- FormViewPagerRow.cs
- FontFaceLayoutInfo.cs
- SqlGatherProducedAliases.cs
- TraceContextEventArgs.cs
- TextBreakpoint.cs
- oledbmetadatacolumnnames.cs
- CacheOutputQuery.cs
- FixedTextBuilder.cs
- PersistenceMetadataNamespace.cs
- CompiledIdentityConstraint.cs
- SQLSingle.cs
- AccessibleObject.cs
- DataBinder.cs
- MatchingStyle.cs
- CellPartitioner.cs
- NumberFunctions.cs
- GPRECTF.cs
- CompatibleComparer.cs
- COM2PropertyDescriptor.cs
- RequestStatusBarUpdateEventArgs.cs
- DetailsViewDeletedEventArgs.cs
- MailDefinitionBodyFileNameEditor.cs
- RelationshipSet.cs
- FixedElement.cs
- Transform.cs
- MaskedTextBoxDesignerActionList.cs
- SqlParameterizer.cs
- CodeTypeParameter.cs
- ByteFacetDescriptionElement.cs
- StateElementCollection.cs
- NavigateEvent.cs
- Setter.cs
- JournalNavigationScope.cs
- ServiceSecurityContext.cs
- ProviderSettingsCollection.cs
- BezierSegment.cs
- DataControlFieldHeaderCell.cs
- GregorianCalendar.cs
- LinkDescriptor.cs
- DbDataAdapter.cs
- WebPartEditorApplyVerb.cs
- DataGridViewHitTestInfo.cs
- HttpMethodAttribute.cs
- ThrowHelper.cs
- MenuItemCollection.cs