Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8088717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:10:12+00:00 2026-06-05T19:10:12+00:00

I was using a CheckedListBox to display a List of Plugin . And i’m

  • 0

I was using a CheckedListBox to display a List of Plugin. And i’m using an EventHandler :

private void myCheckedListBox_SelectedIndexChanged(object sender, EventArgs e)
{
    myGUIUtilities.SetDescription(myCheckedListBox.SelectedItem, myRichTextBox);
}

To display something …
This is the myGUIUtilities.SetDescription method :

internal static void SetDescription(object p_SelectedObject, RichTextBox p_TextBoxDescription)
            {
                AbstractEnvChecker l_Plugin = p_SelectedObject as AbstractEnvChecker;
                if (l_Plugin != null)
                    p_TextBoxDescription.Text = l_Plugin.Description;
            }

To display my Plugins I just used the CheckedListBox.Items.Add method :

MyCheckedListBox.Items.Add(myPlugin);

That accepts an object as argument …

Now i want to classify my Plugins by cetgories, so i’m using TreeView and TreeNode.

The problem is that the TreeView.Nodes.Add(TreeNode node) accepts only TreeNode Type as argument.

And i can’t actually use the same SetDescription method which needs a Plugin Type to get the Plugin.Description Property …

Is there a way to pass an object to the TreeView.Nodes.Add(TreeNode node) method ?
Or another way to do that ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:10:14+00:00Added an answer on June 5, 2026 at 7:10 pm

    Use the Tag property on the tree node to attach an object to it. Then you can pull it back out again later.

    So you could do this (assuming a Name property on the plugin object)

    public TreeNode AddPluginNode(TreeNode parent, AbstractEnvChecker plugin)
    {
      TreeNode created = new TreeNode(plugin.Name) { Tag = plugin };
      parent.Nodes.Add(created);
      return created;
    }
    

    And then you can rewrite the start of your event handler thus:

    AbstractEnvChecker l_Plugin = p_SelectedObject as AbstractEnvChecker;
    if(l_Plugin == null)
    {
      TreeNode selNode = p_SelectedObject as TreeNode;
      if(selNode != null && selNode.Tag != null)
        l_Plugin = selNode.Tag as AbstractEnvChecker;
    }
    //might still be null in the future if you start using Tags for other types.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I create an array containing the checked items in a checkedlistbox using
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using MVVM. I have a DataTemplate which I am using to display an expander
I've got a Checkedlistbox, which is 3 rows high, and large enough to display
i've added a checkbox to a checkedlistbox using the following code: CheckBox cb =
I have made a CheckedListBox using the following: <ListBox x:Name=lst_checkBoxList ItemsSource={Binding}> <ListBox.ItemTemplate> <DataTemplate> <CheckBox
I'm using a CheckedListBox control in a small application I'm working on. It's a
I am using CheckedListBox , but I need to highlight individual items with different
I have an instance of System.Windows.Forms.CheckedListBox which displays a list of tick boxes and
Using VB6.0, How to get itemdata of a selected item in a CheckedListBox?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.