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
- ResourceContainer.cs
- CriticalFinalizerObject.cs
- XmlnsDictionary.cs
- AuthenticationException.cs
- ToolStripManager.cs
- SqlConnectionStringBuilder.cs
- UnauthorizedAccessException.cs
- ForEachAction.cs
- DataGridViewCell.cs
- NameValueConfigurationCollection.cs
- CreateUserWizardDesigner.cs
- XmlSchemaAny.cs
- PromptBuilder.cs
- formatter.cs
- DeploymentExceptionMapper.cs
- CodeDirectoryCompiler.cs
- CultureInfoConverter.cs
- RecognizedPhrase.cs
- HttpRuntime.cs
- DrawingGroup.cs
- ComponentChangedEvent.cs
- ListViewDeleteEventArgs.cs
- CapabilitiesSection.cs
- QilFactory.cs
- RegexCharClass.cs
- RightsManagementPermission.cs
- SaveFileDialog.cs
- CharConverter.cs
- ExtentJoinTreeNode.cs
- EncoderExceptionFallback.cs
- MeasureItemEvent.cs
- XamlContextStack.cs
- ICollection.cs
- TableParagraph.cs
- EventLogReader.cs
- GridPatternIdentifiers.cs
- BindingExpressionUncommonField.cs
- SystemDiagnosticsSection.cs
- SspiWrapper.cs
- EncoderExceptionFallback.cs
- ChannelListenerBase.cs
- Grid.cs
- columnmapfactory.cs
- Opcode.cs
- ImageIndexConverter.cs
- DesignRelation.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- XmlHierarchyData.cs
- HtmlInputPassword.cs
- UnknownBitmapDecoder.cs
- ListControlConvertEventArgs.cs
- EntityReference.cs
- UserControlBuildProvider.cs
- OleDbReferenceCollection.cs
- FieldDescriptor.cs
- SqlProcedureAttribute.cs
- ButtonRenderer.cs
- RoleService.cs
- CheckBox.cs
- ObjectDataSourceWizardForm.cs
- Animatable.cs
- CheckBoxField.cs
- SingleResultAttribute.cs
- WsatStrings.cs
- IProvider.cs
- ModelToObjectValueConverter.cs
- NavigationFailedEventArgs.cs
- MasterPageCodeDomTreeGenerator.cs
- GridViewCancelEditEventArgs.cs
- ServiceModelActivity.cs
- QilStrConcat.cs
- HideDisabledControlAdapter.cs
- UnsafeNativeMethods.cs
- ProviderMetadataCachedInformation.cs
- DataSourceProvider.cs
- BuildProviderUtils.cs
- SelectionChangedEventArgs.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- HMACSHA256.cs
- MessageEncodingBindingElementImporter.cs
- SiteMapPath.cs
- StrokeCollectionDefaultValueFactory.cs
- FloatSumAggregationOperator.cs
- LabelEditEvent.cs
- DeferredTextReference.cs
- DependencyPropertyValueSerializer.cs
- ProxyGenerationError.cs
- UserControlCodeDomTreeGenerator.cs
- FixedSOMTableRow.cs
- SimplePropertyEntry.cs
- TransactionFormatter.cs
- MessageOperationFormatter.cs
- DBCommandBuilder.cs
- WebBrowserHelper.cs
- PrivateFontCollection.cs
- MexHttpBindingCollectionElement.cs
- TokenBasedSet.cs
- Parser.cs
- TypeListConverter.cs
- ModuleBuilder.cs