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
- DoubleLink.cs
- RadioButton.cs
- Token.cs
- DbProviderFactory.cs
- WebSysDescriptionAttribute.cs
- ChannelFactoryRefCache.cs
- WindowsFormsSectionHandler.cs
- PartialToken.cs
- DataGridViewCellPaintingEventArgs.cs
- DispatcherProcessingDisabled.cs
- dbdatarecord.cs
- RSAPKCS1SignatureDeformatter.cs
- DataGridViewAdvancedBorderStyle.cs
- TreeView.cs
- ExtensionsSection.cs
- LayoutTable.cs
- SocketException.cs
- _SSPIWrapper.cs
- XmlWriterDelegator.cs
- ImageCollectionEditor.cs
- DNS.cs
- ProviderCommandInfoUtils.cs
- Ipv6Element.cs
- SupportsPreviewControlAttribute.cs
- TraceUtility.cs
- QueryResponse.cs
- BlockCollection.cs
- MembershipPasswordException.cs
- SelectorItemAutomationPeer.cs
- TaskHelper.cs
- TemplateXamlParser.cs
- DeferredBinaryDeserializerExtension.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- XmlQualifiedName.cs
- TagPrefixCollection.cs
- VisualBasicValue.cs
- MtomMessageEncoder.cs
- Rotation3DAnimationUsingKeyFrames.cs
- Library.cs
- Expressions.cs
- DropSourceBehavior.cs
- NamespaceCollection.cs
- TreeNodeSelectionProcessor.cs
- SimpleBitVector32.cs
- InvalidEnumArgumentException.cs
- OletxResourceManager.cs
- TransformCryptoHandle.cs
- jithelpers.cs
- BrowserInteropHelper.cs
- CodeTypeDeclaration.cs
- SqlDuplicator.cs
- MsmqProcessProtocolHandler.cs
- WCFModelStrings.Designer.cs
- NameValueCollection.cs
- ProgressiveCrcCalculatingStream.cs
- PrintDialog.cs
- XslAstAnalyzer.cs
- CopyNodeSetAction.cs
- X509CertificateClaimSet.cs
- AdapterUtil.cs
- ParenExpr.cs
- HttpPostedFile.cs
- DSASignatureDeformatter.cs
- EntityDataReader.cs
- ExpressionConverter.cs
- SqlMethods.cs
- MonitoringDescriptionAttribute.cs
- PenContext.cs
- TextServicesCompartment.cs
- HttpCapabilitiesEvaluator.cs
- StaticDataManager.cs
- MultiView.cs
- SafeThemeHandle.cs
- DataAccessor.cs
- SyndicationFeedFormatter.cs
- DataGridViewControlCollection.cs
- ServiceModelDictionary.cs
- SmtpDigestAuthenticationModule.cs
- ZeroOpNode.cs
- SQLMembershipProvider.cs
- ErrorWrapper.cs
- SimpleWorkerRequest.cs
- SHA1Cng.cs
- OdbcCommandBuilder.cs
- CommandID.cs
- IResourceProvider.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- TriState.cs
- Popup.cs
- OleDbDataReader.cs
- MiniCustomAttributeInfo.cs
- IApplicationTrustManager.cs
- ListViewGroup.cs
- AssemblyGen.cs
- MetaModel.cs
- COM2PictureConverter.cs
- PluralizationServiceUtil.cs
- XmlEncodedRawTextWriter.cs
- DynamicRenderer.cs
- ComplexLine.cs