ComponentOne Menus and Toolbars for WinForms
Menus and Toolbars for WinForms Task-Based Help / TopicBar Tasks / Adding and Removing TopicBar Items / Removing Topic Links from Topic Pages
In This Topic
    Removing Topic Links from Topic Pages
    In This Topic

    You can remove topic links from topic pages using the floating toolbar, the collection editor, and code. In this topic, you will learn how to remove topic links using each of the aforementioned methods. This topic assumes that you have a C1TopicBar control containing at least one topic link (see Adding Topic Links to Topic Pages) on your page.

    Using the Floating Toolbar

    Complete the following steps:

    1. Using your cursor, hover over the topic link you wish to remove until its floating toolbar appears. The topic link's toolbar appears similar to the following:
      Topic link toolbar
    2. Click the Delete topic link Button button.

    The topic link is removed from the topic page.

    Using the Collection Editor

    Complete the following steps:

    1. Click C1TopicBar's smart tag (Smart tag) to open the C1TopicBar Tasks menu.
    2. On the C1TopicBar Tasks menu, click Edit Pages.
      Edit Pages
      The C1TopicPage Collection Editor opens.
    3. In the Members pane, select a page.
    4. In the Properties grid, locate the Links property and click the ellipsis button Button. The C1TopicLink Collection Editor opens.
    5. In the Members pane, select the link you wish to remove.
    6. Click Remove to remove the link.
    7. Click OK to close the C1TopicPage Collection Editor.
    8. Click OK to close the C1TopicLink Collection Editor. The topic link is removed from the topic page.

    Using Code

    Complete the following steps:

    1. Click C1TopicBar's smart tag (Smart tag) to open the C1TopicBar Tasks menu.
    2. On the C1TopicBar Tasks menu, click Edit Pages.

      The C1TopicPage Collection Editor opens.
    3. In the Members pane, select the page that holds the link you wish to remove.
    4. In the Properties grid, set the page's Tag property to “PageWithLink”. This will allow you to find the page in the code by using the FindPageByTag method.
    5. In the Properties grid, locate the Links property and click the ellipsis button . The C1TopicLink Collection Editor opens.
    6. Select the link you wish to remove in code and, in the Properties grid, set the link's Tag property to “LinkToRemove”. This will give the link a unique indicator, which will allow you to find it in code using the FindLinkByTag method.
    7. Click OK to close the C1TopicPage Collection Editor.
    8. Click OK to close the C1TopicLink Collection Editor.
    9. Double-click the empty portion of the form to open Code view. Notice that a Form_Load event handler has been added to Code view.
    10. Add the following code to the Form_Load event. This code will find the page and link, assign them to variables, and then will remove the link from the page.

      To write code in Visual Basic

      Visual Basic
      Copy Code
      'Find page and assign to variable
      Dim c1TopicPage1 = c1TopicBar1.FindPageByTag("PageWithLink")
      'Find link and assign to variable
      Dim c1TopicLink1 = c1TopicPage1.FindLinkByTag("LinkToRemove")
      'Remove link from page
      c1TopicPage1.Links.Remove(c1TopicLink1)                              
      

      To write code in C#

      C#
      Copy Code
      //Find page and assign to variable 
      var c1TopicPage1 = c1TopicBar1.FindPageByTag("PageWithLink"); 
      //Find link and assign to variable 
      var c1TopicLink1 = c1TopicPage1.FindLinkByTag("LinkToRemove"); 
      //Remove link from page
      c1TopicPage1.Links.Remove(c1TopicLink1);
      
    11. Press F5 to build the project.
    See Also