User Control



Im starting to doing a control this is my code:

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Bubblebar
{
public partial class UserControl1 : UserControl
{
private UserControl1.Botones btn;
public UserControl1()
{
this.btn = new Botones(this);
}




[DesignerSerializationVisibility(DesignerSerializationVisibility.
Content),EditorAttribute("typeof(CollectionEditor)","typeof(System.Drawing.
Design.UITypeEditor)")]
public ControlCollection Controles
{

get
{
return this.Controls;
}
set {
Controles = value;
}
}

public class Botones : CollectionBase
{
private UserControl1 owner;
public Botones(UserControl1 owner)
{
this.owner = owner;

}
public Botones(UserControl1 owner, Objetos colec)
: this(owner)
{
this.Add(colec);
}
public void Add(Objetos value)
{

this.owner.Controls.Add(value);

}


}




}
public partial class Objetos : Panel
{
private Objetos.Imagenes imagen;
public Objetos()
{
imagen = new Imagenes(this);
}
public ControlCollection Controles
{

get
{
return this.Controls;
}
}
public class Imagenes : CollectionBase
{
private Panel owner;
public Imagenes(Panel owner)
{
this.owner = owner;

}

public void Add(Imagenesbtn value)
{

this.owner.Controls.Add(value);

}

}

}
public partial class Imagenesbtn : PictureBox
{

public Imagenesbtn()
{
}



}
}
im creating a control and i add a panel, and then a picturebox into the panel,
when i compile, it runs ok, but when i start ro add controls firts the panel
and before the picturebox, the control editor doesn't respect the type of the
controls that i have on my class there is anything wrong???

Regards

Mayolo

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/winform-controls/200805/1

.



Relevant Pages

  • Re: Some questions about INTRACTIVECHANGE Event.
    ... leaves the control. ... OWNER_ TEXT. ... For example, as a user types in a text box, the InteractiveChange ... A KeyPress event is useful for intercepting keystrokes entered in a ...
    (microsoft.public.fox.helpwanted)
  • Problem with userconntrol
    ... Im starting to doing a control this is my code: ... public partial class UserControl1: UserControl ... public Botones(UserControl1 owner) ... public partial class Imagenesbtn: PictureBox ...
    (microsoft.public.dotnet.framework.windowsforms)
  • RE: [Full-disclosure] RE: [ISN] How To Save The Internet
    ... The point might be better made here that we have many security models ... a box owner may assign so that their access permissions are granted ... the current legal morass over intellectual property is of social value ... Nor is there much up-front discussion for consumers of what they can control, ...
    (Full-Disclosure)
  • Re: NTFS folder permissions - Creator Owner issue (I think)
    ... This would suggest that the only way to control the owner of a new object is ... > I created a file in a folder that had no CREATOR OWNER access control, ... > Permissions effective permissions. ...
    (microsoft.public.security)
  • Re: I applaud Brian France on this issue...
    ... If Nascar doesn't like what the teams ... And they can certainly control tires and testing. ... >> ownership but still sharing information? ... Each owner wants to win the ...
    (rec.autos.sport.nascar)