Visual C# need picturebox with text on top

Associate
Joined
5 Dec 2002
Posts
141
Im trying to design a touchscreen jukebox program in visual c# (free express edition) and need to add a number of picturebox's on the screen then overlay some text on top. I've managed to overlay images(png's) on top of other picturebox's but can't seem to do it with text.

The part of the program is:

for (int i = 0; i < 8; i++)
{
albumTrackBoxes = new PictureBox();
albumTrackBoxes.Size = new Size(400, 50);
albumTrackBoxes.BackColor = Color.YellowGreen;
albumTrackBoxes.BorderStyle = BorderStyle.None;
albumTrackBoxes.Location = new Point(420, 100 + (i * 60));
albumTrackBoxes.TabIndex = i;
Controls.Add(albumTrackBoxes);
Graphics gr = albumTrackBoxes.CreateGraphics();
Font myFont = new Font("Arial", 14);
gr.DrawString("Track ", myFont, Brushes.Blue,420,100+(i*60));
gr.Dispose();
}

At this stage i'm not setting an image for the pictureboxes as I need to design it, so instead just setting a fill colour (YellowGreen). The boxes show on screen as expected but no matter what I do I can't get the text to show.

Any help would be appreciated.
 
Thanks everyone, think I know the problems i've been having now.
Until I get the designs of the background right i'm using label controls instead but this code will help me later.
Thanks
 
Back
Top Bottom