Click here to Skip to main content
15,913,854 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 22:48
Henry Minute30-Jun-09 22:48 
General[Message Deleted] Pin
ice.cool 17291-Jul-09 0:00
ice.cool 17291-Jul-09 0:00 
GeneralRe: Thanks for solution Pin
Henry Minute1-Jul-09 0:20
Henry Minute1-Jul-09 0:20 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk1-Jul-09 2:37
honey.rpk1-Jul-09 2:37 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute1-Jul-09 4:20
Henry Minute1-Jul-09 4:20 
General[Message Deleted] Pin
ice.cool 17291-Jul-09 18:59
ice.cool 17291-Jul-09 18:59 
GeneralRe: How to reduce size of usercontrol in order to make it exhibit expandable and collapsable features? Pin
Henry Minute1-Jul-09 22:35
Henry Minute1-Jul-09 22:35 
AnswerRe: How to make a control as a child to user control but not for a form? Pin
BillWoodruff29-Jun-09 12:43
professionalBillWoodruff29-Jun-09 12:43 
Hi Honey.rpk, D@nish, and Henry,

The roosters have been crowing loud since before 5am here, but nested UserControl hosting at design-time is not what's keeping me up, I assure you Smile | :)

Let me clear this up :

1. I'm using VS 2010 beta.

2. Creating a new Win Forms project in VS 2010 beta does not auto-include a reference to the System.Design dll which, I guess, the other .Design classes depend on. Was this also the case in VS 2008 ?

3. If you make sure you have a reference set to the System.Design dll, and you have declared :

using System.Design;
using System.Windows.Forms.Design;

you can use Henry's technique which is also shown in Matthew McDonald's aforementioned book on page 926.

4. If you don't have a reference in your project to System.Design.dll, you can still use the technique I included in C# which D@nish also pointed you to in an article doing the same thing in VB. I'm surprised this technique works without a reference to System.Design dll being set !

5. Nesting :

a. forget it : an instance of userControl #2 with ParentControlDesigner attribute placed inside userControl #1 with same attribute : followed by placing usercontrol #1 on a form at design-time ... after a build ... is NOT going to let the instance of UserControl #2 capture other controls.

b. if you can't forget it : there is a way (ugly, it is) :

1. build your separate usercontrols 1,2

2. adorn each of them with the ParentControlDesigner attribute

3. at design time on a Form :

a. place an instance of usercontrol #1 on the form

b. place an instance of usercontrol #2 on the form and drag it so is "captured" usercontrol #1

c. you will now find both usercontrols are capable of capturing controls.

d. disclaimer : not tested with derived controls inheriting from containers like Panel

Disclaimer : for all I know there are other more elegant methods to achieve such weirdness; but a good question is : "what design advantages come from such design-time nested usercontrols or derived controls ?"

If anything, I can see such "beasts" as a liability, but, who knows, maybe there is some scenario where such "critters" are just right for the zoo.

best, Bill

"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844

QuestionA small help Pin
ice.cool 172928-Jun-09 21:10
ice.cool 172928-Jun-09 21:10 
Questionneed help Pin
Bahram.Zarrin27-Jun-09 5:47
Bahram.Zarrin27-Jun-09 5:47 
AnswerRe: need help Pin
Luc Pattyn27-Jun-09 6:07
sitebuilderLuc Pattyn27-Jun-09 6:07 
QuestionHow to unbound a databound container in order to capture other controls or to make other controls to act according to designed custom control developed using containers? Pin
ice.cool 172925-Jun-09 22:54
ice.cool 172925-Jun-09 22:54 
AnswerRe: How to unbound a databound container in order to capture other controls or to make other controls to act according to designed custom control developed using containers? Pin
dan!sh 26-Jun-09 18:56
professional dan!sh 26-Jun-09 18:56 
Questionhow to use devcon remove dirver? Pin
iceman861625-Jun-09 14:59
iceman861625-Jun-09 14:59 
AnswerRe: how to use devcon remove dirver? Pin
Henry Minute25-Jun-09 20:28
Henry Minute25-Jun-09 20:28 
GeneralRe: how to use devcon remove dirver? Pin
iceman861628-Jun-09 14:03
iceman861628-Jun-09 14:03 
QuestionHow to add a button to an user control or custom control dynamically? Pin
ice.cool 172924-Jun-09 22:51
ice.cool 172924-Jun-09 22:51 
AnswerRe: How to add a button to an user control or custom control dynamically? Pin
dan!sh 25-Jun-09 1:12
professional dan!sh 25-Jun-09 1:12 
Question[Message Deleted] Pin
ice.cool 172924-Jun-09 21:31
ice.cool 172924-Jun-09 21:31 
AnswerRe: How to design "Forums" using windows application and C# (asp.net)? Pin
dan!sh 25-Jun-09 1:10
professional dan!sh 25-Jun-09 1:10 
AnswerRe: How to design "Forums" using windows application and C# (asp.net)? Pin
Eddy Vluggen25-Jun-09 8:59
professionalEddy Vluggen25-Jun-09 8:59 
GeneralRe: How to design "Forums" using windows application and C# (asp.net)? Pin
Mycroft Holmes25-Jun-09 17:10
professionalMycroft Holmes25-Jun-09 17:10 
GeneralRe: How to design "Forums" using windows application and C# (asp.net)? Pin
Eddy Vluggen25-Jun-09 20:56
professionalEddy Vluggen25-Jun-09 20:56 
QuestionHow to add a child control to a panel in my custom control tool Pin
honey.rpk24-Jun-09 21:04
honey.rpk24-Jun-09 21:04 
AnswerRe: How to add a child control to a panel in my custom control tool Pin
dan!sh 25-Jun-09 1:17
professional dan!sh 25-Jun-09 1:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.