Problem with static objects in c# 2.0

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rxyz
    New Member
    • Feb 2008
    • 3

    Problem with static objects in c# 2.0

    Hi,
    I am facing problem in c# using vs 2.0. I had created windows form named as MainForm.cs.In code-behind class MainForm.Design er.cs some of objects were declared as static. Surprisingly when i double click on my form while developing, all static objects turned into public itself. and that create big problem while debuging.
    for example
    public static System.Windows. Forms.TreeView ApplicationTree ;
    will convert into
    public System.Windows. Forms.TreeView ApplicationTree ;
    automatically when i double click on my form.

    any solution guyz...
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Im not sure why you would want a tree view in a form to be static.

    However, ,both treeview variables are declared as private, its that the static keyword is taken off.

    It might be the fact that you are trying to apply some values to the tree view from the form , or trying to manipulate the form object using the tree view due to which it cannot be static.

    Comment

    Working...