How to fix the errors

Ben Tam 216 Reputation points
2021-08-26T03:04:51.357+00:00

Dear All,

Grateful if anybody tells me how to fix the errors in the attached figure.

TIA

126631-demo.gif

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,288 questions
{count} votes

Accepted answer
  1. Karen Payne MVP 35,116 Reputation points
    2021-08-31T11:30:28.657+00:00

    Seems your project has issues overall that defy what a standard WinForm project should have.

    The only thing I see different between my and your project is the .NET Framework version yet that should not make using static System.Configuration.ConfigurationManager; not to be found.

    So I created a mirror image of the project found here that uses System.Configuration.ConfigurationManager version 5 rather than version 4. I'm going to guess even though this should work it will not as the first version should have worked so try if you want and let me know what happens.


4 additional answers

Sort by: Most helpful
  1. WayneAKing 4,921 Reputation points
    2021-08-26T04:12:56.74+00:00

    Did you follow the instructions here?

    http://objectlistview.sourceforge.net/cs/gettingStarted.html

    "Download the ObjectListView project

    Add the ObjectListView project to your project (right click
    on your solution; choose “Add...”, “Existing Project”, then
    choose the ObjectListView.csproj)

    In your project, add a reference to the ObjectListView project
    (right click on your project; choose “Add Reference...”, choose
    “Projects” tab; then double click on the ObjectListView project)

    Build your project"

    • Wayne

  2. Castorix31 81,826 Reputation points
    2021-08-26T05:37:09.627+00:00

    Add at beginning :

    using BrightIdeasSoftware;
    

  3. Karen Payne MVP 35,116 Reputation points
    2021-08-26T11:19:36.11+00:00

    As @WayneAKing mentioned and @Castorix31 you need the using statement as seen in this code sample in MainForm.cs, line 19. And note the project reference.

    0 comments No comments

  4. Karen Payne MVP 35,116 Reputation points
    2021-08-26T14:42:11.79+00:00

    Try the following project

    Form code

    using System;
    using System.Windows.Forms;
    using `BrightIdeasSoftware;`
    
    namespace ObjectListViewFramework
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                var objectListViewLocal = new ObjectListView();
            }
        }
    }