Click here to Skip to main content
15,884,836 members
Home / Discussions / C#
   

C#

 
AnswerRe: Mapping a real world object to OOP Pin
J4amieC17-Sep-06 21:57
J4amieC17-Sep-06 21:57 
GeneralRe: Mapping a real world object to OOP Pin
wheelerbarry17-Sep-06 23:01
wheelerbarry17-Sep-06 23:01 
GeneralRe: Mapping a real world object to OOP Pin
J4amieC17-Sep-06 23:38
J4amieC17-Sep-06 23:38 
QuestionHow to know that Datagrid values have been modified Pin
vaishali1017-Sep-06 20:35
vaishali1017-Sep-06 20:35 
AnswerRe: How to know that Datagrid values have been modified Pin
Tamimi - Code17-Sep-06 20:56
Tamimi - Code17-Sep-06 20:56 
Questionhow to delete a row in database Pin
faladrim17-Sep-06 20:29
faladrim17-Sep-06 20:29 
AnswerRe: how to delete a row in database Pin
Hamid_RT18-Sep-06 9:30
Hamid_RT18-Sep-06 9:30 
QuestionAdding Child Controls to UserControl at design time Pin
TofuBug2417-Sep-06 19:34
TofuBug2417-Sep-06 19:34 
Hello Everyone,

I've got a little problem that I can't seem to find a straight answer to so I'm throwing it out there for you guys to take a stab at it.

I have a UserControl being developed that has two panel controls.

I have already set the designer attribute to allow child controls at design time

<br />
[DesignerCategoryAttribute("Component")]<br />
[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))]<br />
[ToolboxBitmap(typeof(XPanel),"Image1.bmp")]<br />
public partial class XPanel : UserControl<br />


now i can drag a control on it as is no problem.

what i need to do is when a control is added send it to one of the internal panel's controls collection.

i've tried using the ControlAdded and ControlRemoved events to accomplish this

<br />
    private void XPanel_ControlAdded(object sender, ControlEventArgs e)<br />
    {<br />
      this.DockingPanel.Controls.Add(e.Control);<br />
    }<br />
<br />
    private void XPanel_ControlRemoved(object sender, ControlEventArgs e)<br />
    {<br />
      this.DockingPanel.Controls.Remove(e.Control);<br />
    }<br />


when i drag a control on to it now i get a pop up in visual studio that says


'child' is not a child control of this parent


if someone could tell me what i'm doing wrong or what i'm missing it would be greatly appreciated.

Ryan Strope
AnswerRe: Adding Child Controls to UserControl at design time Pin
Martin#17-Sep-06 21:22
Martin#17-Sep-06 21:22 
GeneralRe: Adding Child Controls to UserControl at design time Pin
TofuBug2418-Sep-06 1:22
TofuBug2418-Sep-06 1:22 
QuestionDeleting a file Pin
saqib8217-Sep-06 19:27
saqib8217-Sep-06 19:27 
AnswerRe: Deleting a file Pin
Jakob Farian Krarup17-Sep-06 19:54
Jakob Farian Krarup17-Sep-06 19:54 
GeneralRe: Deleting a file Pin
Christian Graus17-Sep-06 20:22
protectorChristian Graus17-Sep-06 20:22 
GeneralRe: Deleting a file Pin
Jakob Farian Krarup17-Sep-06 21:26
Jakob Farian Krarup17-Sep-06 21:26 
GeneralRe: Deleting a file Pin
saqib8217-Sep-06 20:51
saqib8217-Sep-06 20:51 
GeneralRe: Deleting a file Pin
Jakob Farian Krarup17-Sep-06 21:27
Jakob Farian Krarup17-Sep-06 21:27 
QuestionMobile projects in C# Pin
yousafzai17-Sep-06 19:17
yousafzai17-Sep-06 19:17 
AnswerRe: Mobile projects in C# Pin
Jakob Farian Krarup17-Sep-06 19:34
Jakob Farian Krarup17-Sep-06 19:34 
QuestionFile Transfer Pin
Madhumathiid17-Sep-06 18:45
Madhumathiid17-Sep-06 18:45 
AnswerRe: File Transfer Pin
Jakob Farian Krarup17-Sep-06 19:25
Jakob Farian Krarup17-Sep-06 19:25 
QuestionXML parsing in c# Pin
aruna_koride17-Sep-06 17:07
aruna_koride17-Sep-06 17:07 
AnswerRe: XML parsing in c# Pin
Bob Nadler18-Sep-06 17:30
Bob Nadler18-Sep-06 17:30 
QuestionRe: XML parsing in c# Pin
aruna_koride18-Sep-06 18:32
aruna_koride18-Sep-06 18:32 
QuestionMainForm not here for working in Code? Pin
xenotronic00717-Sep-06 15:38
xenotronic00717-Sep-06 15:38 
AnswerRe: MainForm not here for working in Code? Pin
Christian Graus17-Sep-06 15:48
protectorChristian Graus17-Sep-06 15:48 

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.