Click here to Skip to main content
15,916,378 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'm working on hacking a custom control I found online, and I'd like to add design-time functionality to it such that a small icon appears in the top left to make it easier to move the control. Right now, there are times when moving the control just doesn't work because the mouse cursor doesn't seem to want to grab onto it properly.

What i'm referring to is functionality similar to the GroupBox control. When it is added, you can see a small + like symbol that when clicked on, selects the control to be moved on the designer.

How can i add something like this to my custom control?
Posted
Comments
[no name] 8-Jan-12 21:38pm    
What environment? ASP.NET or Windows?
agent154 9-Jan-12 6:46am    
Windows Forms

1 solution

agent154 wrote:
—mouse cursor doesn't seem to want to grab onto it properly.
This is called personification, one of the kinds of trope, please see http://en.wikipedia.org/wiki/Trope_%28linguistics%29[^]. (By some reason, this very kind of trope is missing from English Wikipedia page, but it is available in many other languages.)

Even though this observation is very interesting, in my humble opinion, the scientific method is still more productive in technology, please see http://en.wikipedia.org/wiki/Scientific_method[^].

OK, these were very general ideas for you to utilize. :-) Now, you need to go in further detail. :-)

The problem of implementing of the design-time behavior which you described in insufficient detail is not extremely difficult. You need to plan you work thoroughly and implement accordingly, but if you face some problem you cannot solve, try to describe the problem and expected behavior in detail and create some short code sample you tried. In this case, we would gladly help you.

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Jan-12 14:33pm    
Ha-ha, you certainly fail to get some hints. Do you think if you down-vote this answer, someone else will give you the help you need?

I tell you the deal. You need to review your question and make a (short!) code sample that would manifest the problem. It is not a problem to implement such behavior. The only problem is that you screw up somewhere. To sort it out, we need some of your code. There is no other way. If you are reluctant to do this part of work, you hardly can hope for help.

--SA
agent154 11-Jan-12 20:45pm    
I downvote because your response was cheeky and not helpful. You could have done it in a bit more of a polite way, instead of treating me like a child.

And I don't have any code because I don't know how to do it. If you don't feel it apropriate to give me an answer directly, then maybe you could point me in the direction of where to learn. I'm a novice at C#, and barely know anything about making custom controls, aside from inheriting a class and changing small things.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900