问题描述:

I can't find a way to draw a custom control with image and text above it so I could use it as a Drag Drop object. Both text and image path are fetched from XML file. I tried with custom class that would extend PictureBox, but couldn't do it. Images are quite small (65x55px average), but the title can be quite long sometimes so I usually ended with text that was drew only partially. Help anyone?

网友答案:

Maybe consider making a custom control for that. Make a custom control with a pictureBox and a label.

网友答案:

Try making a UserControl! It's like a reusable piece of form real estate. In the UserControl you place a PictureBox and a Label. You can do this right in the Visual Studio GUI. Then look up a drag drop tutorial and and add those events to the UserControl.

相关阅读:
Top