Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / ButtonInternal / RadioButtonStandardAdapter.cs / 1 / 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; } } 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
- ReferencedType.cs
- BindingMemberInfo.cs
- ActivityValidator.cs
- RegionInfo.cs
- BaseCAMarshaler.cs
- IPEndPoint.cs
- CodeVariableReferenceExpression.cs
- XhtmlBasicLabelAdapter.cs
- ProfileEventArgs.cs
- QilParameter.cs
- TextProperties.cs
- QuaternionAnimationBase.cs
- CodeMemberMethod.cs
- SecuritySessionSecurityTokenProvider.cs
- SpeechSeg.cs
- FullTextBreakpoint.cs
- HwndAppCommandInputProvider.cs
- XmlAnyAttributeAttribute.cs
- DataServiceClientException.cs
- DetailsViewUpdateEventArgs.cs
- SafeBitVector32.cs
- MouseCaptureWithinProperty.cs
- OracleBFile.cs
- WinCategoryAttribute.cs
- CngKey.cs
- KnownBoxes.cs
- Point3DAnimationBase.cs
- TileModeValidation.cs
- ProfessionalColorTable.cs
- TextLine.cs
- XmlBinaryWriterSession.cs
- IsolatedStorageFileStream.cs
- SocketElement.cs
- CellParagraph.cs
- UpWmlMobileTextWriter.cs
- ThrowHelper.cs
- ServiceBehaviorAttribute.cs
- SqlAliaser.cs
- DropShadowBitmapEffect.cs
- ObjectSecurity.cs
- EtwTrace.cs
- MissingMemberException.cs
- NavigationPropertySingletonExpression.cs
- ZipIOCentralDirectoryBlock.cs
- MetadataItemEmitter.cs
- CompModSwitches.cs
- TabletCollection.cs
- SqlBuffer.cs
- HelpEvent.cs
- LocalizedNameDescriptionPair.cs
- XmlSchemaSimpleTypeRestriction.cs
- RequestCacheValidator.cs
- AxHost.cs
- DesignDataSource.cs
- InkPresenterAutomationPeer.cs
- CodePageEncoding.cs
- TransformConverter.cs
- ServiceObjectContainer.cs
- XmlChoiceIdentifierAttribute.cs
- PropertyMap.cs
- PeerContact.cs
- SqlMethodTransformer.cs
- XmlSerializerAssemblyAttribute.cs
- SmiMetaDataProperty.cs
- MetadataArtifactLoaderResource.cs
- SafeThreadHandle.cs
- NetworkStream.cs
- XmlNullResolver.cs
- UrlMappingsSection.cs
- FlowDocumentView.cs
- PrtCap_Builder.cs
- DocumentViewer.cs
- GeneralTransform.cs
- CreateUserErrorEventArgs.cs
- XmlSchemaDatatype.cs
- XomlDesignerLoader.cs
- DSGeneratorProblem.cs
- HelpEvent.cs
- ExpressionList.cs
- HitTestFilterBehavior.cs
- Cell.cs
- rsa.cs
- Membership.cs
- UnsafeNativeMethods.cs
- SafeProcessHandle.cs
- TabPage.cs
- IntSecurity.cs
- XmlWriterDelegator.cs
- Misc.cs
- ToolStripOverflow.cs
- ModelItemExtensions.cs
- DataRelationPropertyDescriptor.cs
- SizeChangedEventArgs.cs
- ParameterReplacerVisitor.cs
- BufferedGraphics.cs
- OptionalColumn.cs
- DataBinding.cs
- GridItemPattern.cs
- InternalConfigConfigurationFactory.cs
- NameObjectCollectionBase.cs