本文整理汇总了C#中System.Windows.Forms.TreeView.ClearAllSelection方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.ClearAllSelection方法的具体用法?C# TreeView.ClearAllSelection怎么用?C# TreeView.ClearAllSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeView
的用法示例。
在下文中一共展示了TreeView.ClearAllSelection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
/// <summary>
/// Called by the framework when the designer is being initialized with the designed control
/// </summary>
/// <param name="component"></param>
public override void Initialize(IComponent component)
{
base.Initialize(component);
if (Control is TreeView)
{
try
{
m_oSelectionService = (ISelectionService) GetService(typeof (ISelectionService));
}
catch
{
}
try
{
m_oSelectionService.SelectionChanged += new EventHandler(this.OnSelectionServiceChanged);
}
catch
{
}
try
{
m_oDesignerHost = (IDesignerHost) GetService(typeof (IDesignerHost));
}
catch
{
}
try
{
m_oMenuService = (IMenuCommandService) GetService(typeof (IMenuCommandService));
}
catch
{
}
try
{
m_oDesignerSerializationService = (IDesignerSerializationService) GetService(typeof (IDesignerSerializationService));
}
catch
{
}
try
{
m_oToolboxService = (IToolboxService) GetService(typeof (IToolboxService));
}
catch
{
}
try
{
m_oUIService = (IUIService) GetService(typeof (IUIService));
}
catch
{
}
try
{
m_oComponentChangeService = (IComponentChangeService) GetService(typeof (IComponentChangeService));
}
catch
{
}
m_oTreeView = (TreeView) Control;
m_oTreeView.m_bFocus = true;
m_oTreeView.ClearAllSelection();
m_oTreeView.DesignerHost = m_oDesignerHost;
m_oTreeView.IsDesignMode = true;
if (m_bFirstTime == true)
{
OnComponentCreated(m_oTreeView);
m_bFirstTime = false;
}
try
{
m_oComponentAddedHandler = new ComponentEventHandler(this.OnComponentAdded);
}
catch
{
}
try
{
m_oComponentRemovingHandler = new ComponentEventHandler(this.OnComponentRemoving);
}
catch
{
}
try
{
m_oComponentChangeService.ComponentAdded += m_oComponentAddedHandler;
}
catch
{
}
//.........这里部分代码省略.........