A little problem, and I shall explain the meaning of my program :
----------------------------------------------------------------------------------
I am creating a min-ide screen (I can drag and drop on it some components,
with no events on them : only design).
1. I don't want that the components will act as a real component (there
should not be event on it, when pressing mouse-click, for example).
(disable the events, when clicking - If I knew that, it would solve many
problems).
2. I want to capture some layout events.
It may be a bad solution, but far as I have found yet is :
1. I have created an ide with handles, so I can drag and drop component,
move them, stretch them, etc.
For that I made two controls :
First one is the "visual control" (that has no parent control, but "knows"
how to draw the control (but is not paintable on screen).
Second one is an "active control", which is a pictureBox, that is paintable.
When changing some properties on the first one, such as color, text, etc. I
move the "image" from the first one to second control,
by DrawToBitmap method.
2. For some layout (only layout), because the first control is invisible
one, I capture its event (such as DockChanged, resizing and moving),
and checking the delta of width, height, etc. (For DockChanged - when this
occurred on first control, I do the same for the second one, and do some
changes on width, height, top, left, by checking the deltas).
3. Also, I am using propertyGrid control, that is connected to the first
control (named "active control").
4. Everything works fine, and good, but the only thing that I cannot handle
when anchor is changed.
Solution for that, I think :
4.1. Giving up the anchor property and hide it on property grid (how
doing that ?).
4.2. Changing the first control behavior, that it should act as a
control for design time only.
Summary (Major questions) :
==================
1. Need an elegant solution, and knowing whether my solution is bad or good.
2. How can I "disable" the events on the control (and alow only some
events), so the events won't occur when running my code (such as button
click. There are 10 different components I can drop on screen) ?
3. How can I give up and hide some properties on the propertyGrid control?
Thanks