Click here to Skip to main content
16,020,822 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: how to create a new printer and add to the list Pin
genius_palli30-Jun-09 21:34
genius_palli30-Jun-09 21:34 
GeneralRe: how to create a new printer and add to the list Pin
genius_palli10-Jul-09 2:54
genius_palli10-Jul-09 2:54 
GeneralRe: how to create a new printer and add to the list Pin
Sk9327-Jul-09 23:46
Sk9327-Jul-09 23:46 
Questionhow to use the expandable and collapsable property Pin
honey.rpk29-Jun-09 0:36
honey.rpk29-Jun-09 0:36 
AnswerRe: how to use the expandable and collapsable property Pin
DoctorMick29-Jun-09 5:37
DoctorMick29-Jun-09 5:37 
AnswerRe: how to use the expandable and collapsable property Pin
Rob Smiley30-Jun-09 11:49
Rob Smiley30-Jun-09 11:49 
QuestionHow to make a control as a child to user control but not for a form? Pin
honey.rpk28-Jun-09 21:11
honey.rpk28-Jun-09 21:11 
AnswerRe: How to make a control as a child to user control but not for a form? [modified] Pin
BillWoodruff28-Jun-09 23:20
professionalBillWoodruff28-Jun-09 23:20 
Hi Honey.rpk,

I've tried doing this same thing without success.

The "work-around" I found is this :

1. create a UserControl 'ucPanel

modify ucPanel so it inherits from Panel

[Designer("System.Windows.Forms.Design.ParentControlDesigner,System.Design", typeof(IDesigner))]
public partial class ucPanel : Panel

2. create a UserControl 'ucMaster : use the same Designer attribute above, but leave this a UserControl.

make sure you put references to :

using System.Drawing.Design;
using System.ComponentModel.Design;

Into both UserControls' library declarations as well as whatever else they require.

With a Form open at design-time do this :

1. drop a ucMaster on your form, and style it as you wish.

2. drop a ucPanel on your form, and move it so is "captured" by ucMaster

Now you will find you can drop controls on the ucPanel, and they will be "properly captured" at design-time which you can verify by looking at the Designer.cs code for the Form.

I realize this is not a very satisfactory solution : what you'd like to do, of course, is to design one UserControl and put elements on it like Panels (or TableLayoutPanels, or whatever other container that can "capture" controls at design-time), and then have to only drop the one UserControl on the design surface and have its sub-components also capture.

I have experimented with creating an instance of ucPanel in the constructor of the ucMaster, creating it in the load event of ucMaster, but none of these experiments work.

I'm sure there's a better way, and, hopefully, one of our "real gurus" here will comment.

best, Bill

p.s. highly recommend Matthew McDonald's book on .NET 2.0 Windows Forms and Controls[^] : Chapters 13 and 26 on design-time programming are the single best resources in this area I've found yet.

"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

modified on Monday, June 29, 2009 5:27 AM

AnswerRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 29-Jun-09 0:03
professional dan!sh 29-Jun-09 0:03 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk29-Jun-09 0:57
honey.rpk29-Jun-09 0:57 
GeneralRe: How to make a control as a child to user control but not for a form? [modified] Pin
BillWoodruff29-Jun-09 2:30
professionalBillWoodruff29-Jun-09 2:30 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 29-Jun-09 2:47
professional dan!sh 29-Jun-09 2:47 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
BillWoodruff29-Jun-09 3:38
professionalBillWoodruff29-Jun-09 3:38 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
dan!sh 29-Jun-09 6:51
professional dan!sh 29-Jun-09 6:51 
AnswerRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute29-Jun-09 6:23
Henry Minute29-Jun-09 6:23 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk29-Jun-09 19:01
honey.rpk29-Jun-09 19:01 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute29-Jun-09 23:29
Henry Minute29-Jun-09 23:29 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk29-Jun-09 23:57
honey.rpk29-Jun-09 23:57 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 0:34
Henry Minute30-Jun-09 0:34 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk30-Jun-09 0:58
honey.rpk30-Jun-09 0:58 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 1:08
Henry Minute30-Jun-09 1:08 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 1:22
Henry Minute30-Jun-09 1:22 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
honey.rpk30-Jun-09 2:30
honey.rpk30-Jun-09 2:30 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
Henry Minute30-Jun-09 5:51
Henry Minute30-Jun-09 5:51 
GeneralRe: How to make a control as a child to user control but not for a form? Pin
ice.cool 172930-Jun-09 20:23
ice.cool 172930-Jun-09 20:23 

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.