Weird editor or bug(s)?

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

I have a problem with editor. In MDI parent I have defined several public
static controls (imagelist,listbox etc). From time to time, when I attempt
to compile program it fails because editor changes "public static" to
"public" and changes
all initialization entries of those controls to "this."
Is there a problem with declaring controls as public static or what?
I am tired of copy-pasting code back.
 
Hi Martin

Windows programs (.NET and all others) expect to set up a run-time ownership
hierarchy. Use of "static" in an MDI app sounds like a control would be in
several hierarchies, and as a result Windows would likely get very confused.

Maybe the editor/compiler is saving you from this situation...

Regards

Ron
 
I have a listbox which contains minimized (hidden) MDI forms, so that user
can easily get them. There is also a imagelist which contains several images
which are used from another class (in overriden datagrid column painting to
which I cannot send images directly, while instatiating a form with them in
class is out of question).
It works without any errors, but as I said,sometimes editor erases "static"
and puts "this".
 
Are you defining those objects inside or outside of the sections marked do
not modify, in other words the InitalizeComponent method? The IDE can and
will change things in its designer generated code.
 
Back
Top