Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Custom component selection problem
 

Custom component selection problem

VS2008SP1

I have a component derived from IComponent (tried to derive from Component also)

If two of my components are placed on the form and one of them is selected, then I can't select another one. I have to click somewhere else first, to clear selection.

Changing selection between my component and any another component (for example System.Windows.Forms.Timer) goes without any problems in both directions.

Also, when I try to set some property value to these component, Instead of

_component1.MyProperty ="x";
_component2.MyProperty ="y";


code in designer file, I'm getting

_component1.MyProperty ="x";
_component1.MyProperty ="x";
Something is definitely wrong with component instance identification.

Any help is welcome.
adontz  Tuesday, September 29, 2009 6:51 PM
The clicking thing is weird. In any case, the control designer would be the responsible for this because the designer should have covered your control with a transparent window in order to catch the click events. Which control designer are you using?

The designer file issue is also strange. I have no suggestions for that one yet.
MCP
  • Proposed As Answer byGender Friday, October 02, 2009 6:17 AM
  •  
webJose  Tuesday, September 29, 2009 10:04 PM
For now, I'm using no custom designer for component. I've tried to add empty one, but behavior did not change.
adontz  Wednesday, September 30, 2009 3:29 AM
Hi adontz,

Do you mean if you create a simple class derived from Component class also has the same problem? If so, could you please upload that simple project to a web site such as skydrive.live.com? That can help us to reproduce the issue and try to find a solution.

I am waiting for your reply.

Sincerely,
Kira Qian
Send us any feedback you have about the help from MSFT at fbmsdn@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!
Kira Qian  Wednesday, September 30, 2009 9:15 AM

You can use google to search for other answers

Custom Search

More Threads

• inherited forms, overlooking something
• How to enable scrolling custom form designer using the middle mouse button?
• How to load a form by myself ?
• DefaultValue question
• Custom control with two child controls: one of them isn't autoscaling
• Collection Editor
• Printing a pictureBox
• When is GetStandardValues called?
• Region Master Controls and VS 2003
• Form designer & setting visibility