views:

554

answers:

2

There is the first time I'm going to do a particular control in C#. The control is a ListBox of items that will have an up arrow and a down arrow on the side. When you select an item in the ListBox, you can use the up and down arrow arrows to reposition that item in the ListBox.

My two questions are: (1) Is there a prebuilt control for something like this, before I start writing my own?

and if not

(2) I'm not sure what control to use for the up / down arrows. I could use buttons that say "Up" and "Down", but I'd prefer actual arrows and am not sure the best way to go about making those.

I am using VisualStudio2008 and .NET Framework 2.0.

A: 
  1. There is not a pre-built control for this, but it is easily accomplished using a ListBox and two buttons.
  2. Use the buttons' Image property.
Charlie
+1  A: 

You can use the plain System.Windows.Forms.Button class, and set its Image property. From the docs:

private void SetMyButtonProperties()
{
    // Assign an image to the button.
    button1.Image = Image.FromFile("C:\\Graphics\\MyBitmap.bmp");
    // Align the image on the button
    button1.ImageAlign = ContentAlignment.MiddleRight;    
}
Ben M
Cool. Sounds good. Thanks for the tip.
Kivus