本文整理匯總了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
{
}
//.........這裏部分代碼省略.........