User Control
- From: "Mayolo Juarez via DotNetMonster.com" <u7844@uwe>
- Date: Mon, 19 May 2008 00:31:28 GMT
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
.
- Prev by Date: ComboBox DropDownStyle = DropDown and selected text
- Next by Date: RE: ComboBox DropDownStyle = DropDown and selected text
- Previous by thread: ComboBox DropDownStyle = DropDown and selected text
- Next by thread: Double click label and its text appears on the clipboard
- Index(es):
Relevant Pages
|
|