473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with static objects in c# 2.0

3 New Member
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...
Feb 26 '08 #1
1 895
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
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.
Feb 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4047
by: Vinay Aggarwal | last post by:
I have been thinking about the lazy initialization and double checked locking problem. This problem is explain in detail here http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html I am not fully convinced that this problem cannot be solved. I am going to propose a solution here. For the sake of discussion I will post my solution here. It is possible that the proposed solution does not work, feedback and comments are...
5
1813
by: Luther Baker | last post by:
Hi, Is the order of initialization guaranteed for static members as it is for instance members? Namely, the order they appear the in the declaration? ie: foo.h:
4
2404
by: Leslaw Bieniasz | last post by:
Cracow, 20.09.2004 Hello, I need to implement a library containing a hierarchy of classes together with some binary operations on objects. To fix attention, let me assume that it is a hierarchy of algebraic matrices with the addition operation. Thus, I want to have a virtual base class class Matr;
5
1396
by: Patrick | last post by:
I want to access an object that is instantiated in the frmMain method from within a static method. When I try to access this object, I get errors that state "Object reference not set to an instance of an object." I know this is a scope problem, but I don't know how to solve it. My application is a winforms app and I'm instatiating the object from frmMain(). The object is declared: public static DataAccess myDataAccessor; What do I...
10
2234
by: Opa | last post by:
I have tried for two days to solve this problem with no luck. I have a singleton class which has some events declared. When I inherit from this class the events don't seem to come along with it. The event in the singleton class always evaluates to null even when I cleary subscribe to it. Does anyone have some sample code of how to do this, or is this not possible.
3
1588
by: geoffblanduk_nospam | last post by:
Given a set of intervals {i1, i2, i3, ...} a list is produced; the base items (0) are placed one at a time into the stream and after the ix one a interval item (1, 2, 3, etc) of the correct type is created. When intervals intersect the order is kept (most frequent first). For example, given the intervals {2, 5, 10} I produce a stream of objects as follows; 0 0 1 0 0 1 0 2 0 1 0 0 1 0 0 1 2 3 0 0 1 0 0 1 0 2 0 1...
5
1744
by: Eric | last post by:
I am implementing a variation on the Singleton design pattern, that allows up to 8 objects of a class to be instantiated, and returns a null pointer for anything more than 8. I am running into a compile problem with GNU g++. Here is the code: /******************** FILE sample.h ********************/
6
3271
by: per9000 | last post by:
An interesting/annoying problem. I created a small example to provoke an exception I keep getting. Basically I have a C-struct (Container) with a function-pointer in it. I perform repeated calls to the function in the container. I allocate (and free in c) arrays to get garbage collection in both C and C#. After a few seconds I get an exception. I assume GarbageCollector moves the delegate (or collects is) and when I don't find it in C...
14
6027
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared static inside functions (i.e. local static objects) 5. objects declared at file scope.
25
2363
by: biplab | last post by:
Hi all, I am using TC 3.0..there if I declare a integer array with dimension 162*219...an error msg saying that too long array is shown....what should I do to recover from this problem???
0
10315
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.