Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

First of all, hello

This is my first thread here so I feel a aslight introdaction is in order.

My name is Gidi Morris, and I have only reacently moved, proffesionally, from DBA (Oracle) to application (.Net), and so I'm in the whole process of relearning what I knew before moving to databases, about actual programming. Hence I will be around alot :) since my regular community (Yaxay.com) is all desgn and web-programming, and no good at things like .Net.

 

Any way - my problem:

I've made a custom control I call DocumentLayout, which is basicaly the document display in Outlook 2003 (Where E-mails are displayed). (See screenshot)

 

My problem is that at the moment contents are added through methods where the aparameters are objects which inherit from Control (Such as Panel and Button). What I want is for programmers to be able to drag controls from the toolbox and drop them into the control.

 

How can I do this?

 

P.S.:

I'm building a library of controls I've made during my study of .Net and C# so its in your interest to help me, since I plan on releasing all my control to the public :D

Latly it would seem as though I'm don't abnegate from anything... except women. :( :)
  • *Experts*
Posted
If I understood your question correctly then inheriting your control from ContainerControl rather then Control will allow the design time drag-and-drop of controls onto your control since then your cotnrol will be a container.
Posted

Ok, I'll try it and let you know :)

 

Thanks.

 

I hope it won't crash the whole thing, since at the moment I inherit from UserControl, which ibviously isn't something you can just go and switch :D

 

we will see..

Latly it would seem as though I'm don't abnegate from anything... except women. :( :)
Posted

Ok, it worked great - except for 1 thing:

 

It added the control to the actuall Object, and it is only the Panel in the center (the white part in the screen-shot that should contain the control. Is there a way for me to redirect the controls added to the Object in design time to that Panel instead of the object's "Controls" member?

 

(Other than manually moving them at load time?)

Latly it would seem as though I'm don't abnegate from anything... except women. :( :)
  • *Experts*
Posted
One thing, why not directly inherit the panel? If the only reason you are doing it like that to have a grey border like that then don't do it. You can easily draw your own border using GDI+ in the control's paint event.
Posted
I thought of that (thats what I meant by "manually"), but I do add controls to it in the class's definition, which I do want, so what I need is a way to tell weather the controls were added during design/run time and not during the class's constraction.
Latly it would seem as though I'm don't abnegate from anything... except women. :( :)
Posted
The reason I'm doing it that way is because there is more to it than you can see in the image. I have several panels there, in order to force particular layout behavior. I can't realy explain it, you'll see when I release the control's source code.
Latly it would seem as though I'm don't abnegate from anything... except women. :( :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...