Hey all,
I'm in the process of working through some examples in a book and had a couple of questions that I am having a little bit of a problem with. So hopefully, with your help they can be cleared up. I am creating a control that consists of several other controls
1) My control is completely cosmetic. It doesn’t really need to have any function but custom property setting. Is there any way to block all the stuff that comes with the control and only show the properties, events, etc that I make I thought adding the <System.ComponentModel.Browsable(False)> before each of the predefined methods would block it from being shown in the designers code window but I guess I either did it wrong or it's not the way to go about it.
2) When the user clicks on my control (since it takes up the whole form, can I automatically set it so that it goes to the forms code window. In other words, when they click on my control can I make it go automatically to form1_load instead of control1_click
3) If anyone knows any good examples about controlling a forms behavior through controls, please let me know.
The example in the book I am reading is very vague and doesn't go into much detail.
Thank you for the time.
Charlie

Custom controls(user control project)
mnemonic
Rigeto
(Moved to Windows Forms general)
I don't understand everything in your post, maybe it would help if you would explain what kind of behaviour you are trying to achieve.
1. The Browsable attribute indeed is used to determine whether your property or event shows up in the designer. You seem to set it to a method
You can have complete control over the visibility of the properties in a propertygrid in another way, which is described here:
http://www.codeproject.com/cs/miscctrl/Dynamic_Propertygrid.asp
2. If you put a control on a form, you can respond to its events in the form. But I'm afraid that's not what you're after Is it on purpose that you would route the click to the load event of the Form
ali_khankan
Some thing that may be possible is to create your own ControlDesigner, and make your own behaviour for clicking on a control. But I doubt whether it will be possible to redirect behaviour to a completely other control.
I also hope you understand that setting the Browsable attribute to a method will not work. Methods are not browsable.
I am really curious as why you would want to have a control as some sort of proxy or substitute for the client rectangle of the form. Why is that
riddler_69
Thanks for the answer and sorry it took so long to get back to you. My mother passed away this last week and I haven't had a chance to really do anything.
Basically, I created my own border for a form to give my program a more skinable feel. Sick of looking at the blue title bar..
What I wanted to do is wrap it up as a control that would automatically set the propery of the form to be borderless and use my own custom border.
Since it serves no other purpose than that, i wanted to remove all of the other stuff not associated with it.
That is the reason that i wanted it to default to the main form when i clicked anywhere in the control.
Thanks again,
Charlie
Tarung
1) yes I tried to set it to a method. Basically, since the control has no use other then cosmetic, I didn't want it to have resize, click, onpaint, etc.. methods available in the code window.
2)you are correct again. The control itself automatically fills the form.
Since I do not want the control to be something programable, I was hoping that when you double clicked on it and opened the code window, it would default to the forms methods. in other words, instead of double clicking on the control and having control1_click pop up in the code window it would show form1_whatever in the code window.
I hope that clears it up
Thank you again
Charlie
C.P.Hardcastle
First of all, my sincere condolences. That must be really hard.
As far as what you are trying to achieve, there are much better ways to accomplish similar behaviour, which is explained here.