Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hi,
 
my problem is about that i have a pannel, into this panels i create several pictureboxes with the default constructor of my class.
 
this is ment like that:
 
class XY
{
public PictureBox picturebox 1;
public PictureBox picturebox2;
public Label LabelNum;
 
public XY(int id, int y_koordinates)
{
 picturebox 1 = new picturebox();
 //Add location etc..
 picturebox2 = new picturebox();
 // Add locations etc..
 LabelNum = new picturebox();
 //Add locations etc..
}
 
}
 
now i have from the first picturebox1, a lot of them.
The second Picturebox is ment by background image of the picturebox1, ATTENTION
i have tried picturebox1.background image, but that resizes that image and it doesnt have to do that, because the "background image" should be bigger in width as the picturebox1.
 
LabelNum schould be Just the ID, that the user gets more kontroll about the picturebox, it just should display the number of all picturebox.
 
And here comes the problem, i have tried everything, but the picturebox2 is in front of the LabelNum, so that i can see just a little bit of the number.
 
The picturebox1 is on start moving, so until you dont start you dont see the labels, after start its ment that you should see it.
 
€:
- I am very sorry for my bad explanaition but i didnt thought that this is such
a problem that everybody have to know what i exatly do.
 
I try now to describe it better:
 
Its about a dograce. You can set how much dogs are running and they get generated.
Every dog hast a picturebox in Constructor as picturebox1 so i get that much
pictureboxes like dogs.
 
The dogs background image is a Racetrack, is from start to the finish line long and have no funktion, its just visual like the label.
picturebox2
 
And the labels are just used to be for showing the Dog ID on the Racetrack, to know the running dogs ID, othervise you have to count on your own wich dog is the dog you have bet on it.
 
Thank you for your Help
 
Greets Niko
Posted 15-Nov-12 2:46am
Edited 15-Nov-12 3:42am
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I don't thikn anyone can figure out what you're trying to do. Remember, we can't see your monitor, whats in your project, how it's coded, of read your mind.
 
But, it sounds as though you're using PictureBoxes for something other than what they were intended for.
 
I think you would be far better served by painting all these images yourself instead of wrestling with the functionality of the PictureBox control.
  Permalink  
Comments
niko_tells at 15-Nov-12 8:40am
   
Updated Question at €:
Dave Kreskowiak at 15-Nov-12 9:55am
   
Yeah, ditch ALL of the PictureBoxes and just draw the images and text labels yourself.
 
I suggest reading up on the Graphics class and it's Draw methods.
 
That way, you've got complete control over what gets drawn on top and when.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
Would be a bit clear about what you are trying to achieve.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.150129.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100