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
- PropertySegmentSerializationProvider.cs
- ping.cs
- PolicyException.cs
- SmtpLoginAuthenticationModule.cs
- DataGridViewRowCollection.cs
- ReadOnlyHierarchicalDataSourceView.cs
- SecurityAttributeGenerationHelper.cs
- ValidatedControlConverter.cs
- HorizontalAlignConverter.cs
- DrawingVisualDrawingContext.cs
- ProcessModule.cs
- CheckBoxFlatAdapter.cs
- Graph.cs
- GrammarBuilderWildcard.cs
- SHA1CryptoServiceProvider.cs
- SinglePageViewer.cs
- _UncName.cs
- ArrayItemValue.cs
- DateTimePicker.cs
- NavigationFailedEventArgs.cs
- FilteredDataSetHelper.cs
- WindowsRebar.cs
- DefaultPropertyAttribute.cs
- SoapInteropTypes.cs
- WebBaseEventKeyComparer.cs
- ActivatedMessageQueue.cs
- WebSysDefaultValueAttribute.cs
- RoutedEventHandlerInfo.cs
- SettingsBindableAttribute.cs
- DBSqlParserTable.cs
- MultipartIdentifier.cs
- cache.cs
- UpdateCommand.cs
- MimeWriter.cs
- PrivacyNoticeElement.cs
- LogEntrySerializationException.cs
- PhoneCall.cs
- SqlConnectionPoolProviderInfo.cs
- HttpStreamFormatter.cs
- SafeViewOfFileHandle.cs
- DataGridToolTip.cs
- ClientSettingsSection.cs
- categoryentry.cs
- WriteTimeStream.cs
- ExecutionEngineException.cs
- PointCollectionValueSerializer.cs
- ButtonColumn.cs
- SpeakCompletedEventArgs.cs
- TypefaceCollection.cs
- CalloutQueueItem.cs
- XmlSchemaValidationException.cs
- RolePrincipal.cs
- DBPropSet.cs
- RichTextBoxAutomationPeer.cs
- DropShadowEffect.cs
- SubpageParagraph.cs
- SQLDateTime.cs
- DataBoundControlHelper.cs
- StyleModeStack.cs
- CrossAppDomainChannel.cs
- WebUtil.cs
- MatrixTransform.cs
- FocusWithinProperty.cs
- ErrorItem.cs
- MiniCustomAttributeInfo.cs
- Link.cs
- SuppressedPackageProperties.cs
- Exceptions.cs
- Variable.cs
- GeneralTransform.cs
- ConversionContext.cs
- PolicyValidationException.cs
- ActivityDelegate.cs
- PageFunction.cs
- DeobfuscatingStream.cs
- FontNameEditor.cs
- SelectionProviderWrapper.cs
- RenderOptions.cs
- ListViewGroupItemCollection.cs
- PLINQETWProvider.cs
- PartialClassGenerationTaskInternal.cs
- DataTemplateKey.cs
- ReplyChannelAcceptor.cs
- ImportedPolicyConversionContext.cs
- DrawingCollection.cs
- CodeDirectiveCollection.cs
- ScrollItemProviderWrapper.cs
- ToolStripItemDesigner.cs
- ScriptModule.cs
- UIElementAutomationPeer.cs
- PersonalizationStateQuery.cs
- EarlyBoundInfo.cs
- DBCommandBuilder.cs
- ToolStripGripRenderEventArgs.cs
- ParenthesizePropertyNameAttribute.cs
- XAMLParseException.cs
- DataGridViewComboBoxCell.cs
- DoubleLinkList.cs
- DefaultObjectMappingItemCollection.cs
- CodePageUtils.cs