Bitmap List items selected just like Bitmap
up vote
0
down vote
favorite
Within a usercontrol derived class I can do the following.
Bitmap whocares;
public Bitmap WhoCares { get { return whocares; } set { whocares = value; } }
This gives me the capability to "Select Resource" for this bitmap.
What I would like to do is have a list of Bitmap, all selectable like this.
List<Bitmap> blabla = new List<Bitmap>();
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This gives me a "Bitmap collection Editor", but it does not create valid bitmap objects.
I've created a derived class of CollectionEditor, called ImagesEditor
class ImagesEditor : CollectionEditor
{
public ImagesEditor(Type type) : base(type)
{
}
protected override object CreateInstance(Type type)
{
UITypeEditor editor = new System.Drawing.Design.BitmapEditor();
return editor.EditValue(this.Context, null);
}
protected override CollectionForm CreateCollectionForm()
{
CollectionForm form = base.CreateCollectionForm();
form.Text = "List of Images Editor";
return form;
}
}
//somewhere else
List<Bitmap> blabla = new List<Bitmap>();
[Editor(typeof(ImagesEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible | DesignerSerializationVisibility.Content)]
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This prompts me (when clicking the add button) to select a bitmap file to import for use by my control. I want it to be "select resource".
How might I go about accomplishing this?
c# list resources controls
add a comment |
up vote
0
down vote
favorite
Within a usercontrol derived class I can do the following.
Bitmap whocares;
public Bitmap WhoCares { get { return whocares; } set { whocares = value; } }
This gives me the capability to "Select Resource" for this bitmap.
What I would like to do is have a list of Bitmap, all selectable like this.
List<Bitmap> blabla = new List<Bitmap>();
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This gives me a "Bitmap collection Editor", but it does not create valid bitmap objects.
I've created a derived class of CollectionEditor, called ImagesEditor
class ImagesEditor : CollectionEditor
{
public ImagesEditor(Type type) : base(type)
{
}
protected override object CreateInstance(Type type)
{
UITypeEditor editor = new System.Drawing.Design.BitmapEditor();
return editor.EditValue(this.Context, null);
}
protected override CollectionForm CreateCollectionForm()
{
CollectionForm form = base.CreateCollectionForm();
form.Text = "List of Images Editor";
return form;
}
}
//somewhere else
List<Bitmap> blabla = new List<Bitmap>();
[Editor(typeof(ImagesEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible | DesignerSerializationVisibility.Content)]
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This prompts me (when clicking the add button) to select a bitmap file to import for use by my control. I want it to be "select resource".
How might I go about accomplishing this?
c# list resources controls
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Within a usercontrol derived class I can do the following.
Bitmap whocares;
public Bitmap WhoCares { get { return whocares; } set { whocares = value; } }
This gives me the capability to "Select Resource" for this bitmap.
What I would like to do is have a list of Bitmap, all selectable like this.
List<Bitmap> blabla = new List<Bitmap>();
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This gives me a "Bitmap collection Editor", but it does not create valid bitmap objects.
I've created a derived class of CollectionEditor, called ImagesEditor
class ImagesEditor : CollectionEditor
{
public ImagesEditor(Type type) : base(type)
{
}
protected override object CreateInstance(Type type)
{
UITypeEditor editor = new System.Drawing.Design.BitmapEditor();
return editor.EditValue(this.Context, null);
}
protected override CollectionForm CreateCollectionForm()
{
CollectionForm form = base.CreateCollectionForm();
form.Text = "List of Images Editor";
return form;
}
}
//somewhere else
List<Bitmap> blabla = new List<Bitmap>();
[Editor(typeof(ImagesEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible | DesignerSerializationVisibility.Content)]
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This prompts me (when clicking the add button) to select a bitmap file to import for use by my control. I want it to be "select resource".
How might I go about accomplishing this?
c# list resources controls
Within a usercontrol derived class I can do the following.
Bitmap whocares;
public Bitmap WhoCares { get { return whocares; } set { whocares = value; } }
This gives me the capability to "Select Resource" for this bitmap.
What I would like to do is have a list of Bitmap, all selectable like this.
List<Bitmap> blabla = new List<Bitmap>();
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This gives me a "Bitmap collection Editor", but it does not create valid bitmap objects.
I've created a derived class of CollectionEditor, called ImagesEditor
class ImagesEditor : CollectionEditor
{
public ImagesEditor(Type type) : base(type)
{
}
protected override object CreateInstance(Type type)
{
UITypeEditor editor = new System.Drawing.Design.BitmapEditor();
return editor.EditValue(this.Context, null);
}
protected override CollectionForm CreateCollectionForm()
{
CollectionForm form = base.CreateCollectionForm();
form.Text = "List of Images Editor";
return form;
}
}
//somewhere else
List<Bitmap> blabla = new List<Bitmap>();
[Editor(typeof(ImagesEditor), typeof(UITypeEditor))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible | DesignerSerializationVisibility.Content)]
public List<Bitmap> BlaBla { get { return blabla; } set { blabla = value; } }
This prompts me (when clicking the add button) to select a bitmap file to import for use by my control. I want it to be "select resource".
How might I go about accomplishing this?
c# list resources controls
c# list resources controls
edited Nov 15 at 20:19
asked Nov 8 at 19:29
uglyoldbob
2716
2716
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214859%2fbitmap-list-items-selected-just-like-bitmap%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown