0

I am making a gtk# 2 application using Monodevelop.

I have made a simple GUI, with a Window and a Vbox as its child in order to use it from the runtime and add more stuff later on.

It seems though that i cannot access the vbox from the code.

This is the code:

namespace test
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            Application.Init ();
            MainWindow win = new MainWindow ();
            TreeView tree = new TreeView ();
            Console.WriteLine(win.Child.Name);
            Mainvbox=win.vbox2;
...
}}}

The error i get is this: Error CS0122: `MainWindow.vbox2' is inaccessible due to its protection level (CS0122) (test)

Greg K.
  • 686
  • 1
  • 5
  • 18

1 Answers1

1

vbox2 may be private/protected, write a property accessor to return it in MainWindow's class (or access it within MainWindow code).

knocte
  • 16,941
  • 11
  • 79
  • 125