Code:
/ DotNET / DotNET / 8.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
- XPathNodeHelper.cs
- XmlWriterSettings.cs
- GeneralTransform.cs
- PathSegment.cs
- SecurityException.cs
- SqlDataSourceEnumerator.cs
- BypassElementCollection.cs
- QilReplaceVisitor.cs
- ServicePointManagerElement.cs
- Util.cs
- HttpModuleActionCollection.cs
- XmlResolver.cs
- FunctionParameter.cs
- PathGeometry.cs
- MsdtcWrapper.cs
- ArrayMergeHelper.cs
- DoubleLinkListEnumerator.cs
- SemaphoreFullException.cs
- SerializationHelper.cs
- NativeWindow.cs
- ValidationErrorEventArgs.cs
- ProcessInfo.cs
- RuntimeConfigurationRecord.cs
- AssemblyInfo.cs
- DbConnectionClosed.cs
- PriorityBindingExpression.cs
- TreeViewEvent.cs
- DesignerCatalogPartChrome.cs
- OutOfProcStateClientManager.cs
- Comparer.cs
- OracleConnection.cs
- PageBreakRecord.cs
- ContextBase.cs
- DbCommandDefinition.cs
- PropertyEmitter.cs
- ConnectionConsumerAttribute.cs
- ViewGenResults.cs
- OutOfProcStateClientManager.cs
- PerfCounters.cs
- EntityDataSourceValidationException.cs
- WCFModelStrings.Designer.cs
- AuthorizationSection.cs
- ExtensionDataObject.cs
- controlskin.cs
- ExternalException.cs
- MetaModel.cs
- WebOperationContext.cs
- GridViewDeletedEventArgs.cs
- Formatter.cs
- PathSegment.cs
- BaseParser.cs
- XmlValueConverter.cs
- WsatAdminException.cs
- Mouse.cs
- ReflectionPermission.cs
- ProfileModule.cs
- AliasedSlot.cs
- PropertyToken.cs
- LayoutUtils.cs
- ResourceAttributes.cs
- XmlSchemaImporter.cs
- DoubleLinkListEnumerator.cs
- HtmlMeta.cs
- PerspectiveCamera.cs
- BaseTemplateCodeDomTreeGenerator.cs
- BrushValueSerializer.cs
- ADMembershipUser.cs
- BufferedStream.cs
- DocumentSchemaValidator.cs
- InstanceCreationEditor.cs
- DataRecordInfo.cs
- XmlObjectSerializerReadContext.cs
- DrawingAttributes.cs
- DPCustomTypeDescriptor.cs
- InvokeCompletedEventArgs.cs
- MobilePage.cs
- SwitchElementsCollection.cs
- XmlDocumentFragment.cs
- Stack.cs
- AttachmentService.cs
- ListBoxItem.cs
- XPathSelfQuery.cs
- SecurityRuntime.cs
- ProcessHostConfigUtils.cs
- TraceContext.cs
- MasterPageCodeDomTreeGenerator.cs
- PersonalizationStateInfoCollection.cs
- WeakReferenceEnumerator.cs
- EntityViewContainer.cs
- MultiAsyncResult.cs
- TextSelectionHelper.cs
- GraphicsContext.cs
- FixedSOMImage.cs
- Comparer.cs
- X509ServiceCertificateAuthentication.cs
- ExtenderControl.cs
- MiniAssembly.cs
- LocalBuilder.cs
- TrackingStringDictionary.cs
- WasNotInstalledException.cs