Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DataGridViewToolTip.cs / 1305376 / DataGridViewToolTip.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
using System.Security;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;
namespace System.Windows.Forms
{
public partial class DataGridView
{
private class DataGridViewToolTip
{
DataGridView dataGridView = null;
ToolTip toolTip = null;
private bool toolTipActivated = false;
public DataGridViewToolTip(DataGridView dataGridView)
{
this.dataGridView = dataGridView;
}
public bool Activated
{
get
{
return this.toolTipActivated;
}
}
public ToolTip ToolTip
{
get
{
return this.toolTip;
}
}
public void Activate(bool activate)
{
if (this.dataGridView.DesignMode)
{
return;
}
// Create the tool tip handle on demand.
if (activate && this.toolTip == null)
{
this.toolTip = new ToolTip();
this.toolTip.ShowAlways = true;
this.toolTip.InitialDelay = 0;
this.toolTip.UseFading = false;
this.toolTip.UseAnimation = false;
this.toolTip.AutoPopDelay = 0;
}
if (this.dataGridView.IsRestricted)
{
IntSecurity.AllWindows.Assert();
}
try
{
if (activate)
{
this.toolTip.Active = true;
this.toolTip.Show(this.dataGridView.ToolTipPrivate, this.dataGridView);
}
else if (this.toolTip != null)
{
this.toolTip.Hide(this.dataGridView);
this.toolTip.Active = false;
}
}
finally
{
if (this.dataGridView.IsRestricted)
{
CodeAccessPermission.RevertAssert();
}
}
this.toolTipActivated = activate;
}
public void Dispose()
{
if (this.toolTip != null)
{
this.toolTip.Dispose();
this.toolTip = null;
}
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlWrappingReader.cs
- EtwTrace.cs
- BoolExpression.cs
- updateconfighost.cs
- FormsAuthenticationModule.cs
- DataBindEngine.cs
- XPathConvert.cs
- StringConcat.cs
- TraceSwitch.cs
- ThreadExceptionDialog.cs
- PieceNameHelper.cs
- ConstructorArgumentAttribute.cs
- HtmlToClrEventProxy.cs
- RepeatBehaviorConverter.cs
- WindowsAuthenticationEventArgs.cs
- _FixedSizeReader.cs
- RectangleGeometry.cs
- DelayedRegex.cs
- TypeKeyValue.cs
- RowToFieldTransformer.cs
- CatalogZoneDesigner.cs
- StateBag.cs
- WorkflowTraceTransfer.cs
- RoutedEventHandlerInfo.cs
- BinHexEncoder.cs
- Int64Storage.cs
- XmlQueryTypeFactory.cs
- BasicExpandProvider.cs
- InvokePatternIdentifiers.cs
- TextTabProperties.cs
- SharingService.cs
- KnownTypes.cs
- QueueProcessor.cs
- IdentityNotMappedException.cs
- MissingMemberException.cs
- ObjectDataSourceView.cs
- SessionStateContainer.cs
- Misc.cs
- CursorConverter.cs
- ButtonStandardAdapter.cs
- LineInfo.cs
- SignatureResourcePool.cs
- CaseStatement.cs
- IntegerValidatorAttribute.cs
- WebPartDescriptionCollection.cs
- RegularExpressionValidator.cs
- GifBitmapEncoder.cs
- QilReplaceVisitor.cs
- RC2CryptoServiceProvider.cs
- HostTimeoutsElement.cs
- PopupEventArgs.cs
- ObjectStateEntryDbDataRecord.cs
- PipelineModuleStepContainer.cs
- Error.cs
- Animatable.cs
- ManagementObjectCollection.cs
- ReadOnlyMetadataCollection.cs
- TextBox.cs
- XmlSchemaSimpleTypeList.cs
- ValidationSettings.cs
- WindowsToolbarAsMenu.cs
- DataGridViewCellCollection.cs
- State.cs
- BindingGraph.cs
- AutoResetEvent.cs
- Reference.cs
- AsyncStreamReader.cs
- ProcessHostConfigUtils.cs
- ToolStripItemRenderEventArgs.cs
- DetailsViewUpdatedEventArgs.cs
- SplitterCancelEvent.cs
- AxHost.cs
- SaveFileDialog.cs
- TargetParameterCountException.cs
- D3DImage.cs
- XAMLParseException.cs
- DescriptionAttribute.cs
- DoubleCollectionValueSerializer.cs
- StylusEditingBehavior.cs
- PrimitiveXmlSerializers.cs
- Rule.cs
- WebFormsRootDesigner.cs
- PrintPreviewGraphics.cs
- FileDialog.cs
- StructuredType.cs
- Site.cs
- StringValidator.cs
- DiagnosticsConfigurationHandler.cs
- DependencyPropertyConverter.cs
- NavigationWindow.cs
- NavigationCommands.cs
- Itemizer.cs
- Size3DValueSerializer.cs
- CacheForPrimitiveTypes.cs
- ControlIdConverter.cs
- ImageButton.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- ResolvedKeyFrameEntry.cs
- VarRefManager.cs
- Shape.cs