|
This afternoon I was making a very long code to display a series of activities in a graphic way.
Each activity is represented by a nice button, and between activities there are pointing arrows and start and end markers (these last ones aren't implemented yet). Something similar to a workflow.
It's a very simplistic chain of runtime generated buttons, so it has no point posting the code. The code just align the buttons, break them in lines, calculates coordinates, etc.
The buttons are in front of a picturebox that should display the static objects, that is the arrows and the markers (and setting the background color to fuzzy button boundaries). Buttons has two images: one for normal state (not pressed, with shadow), and anothe for pressed state. That's working perfectly.
The upper half of the main form is filled with this 'graphic' thing, which resizes automatically depending on its size. The bottom half has some comboboxes and datagriedviews, to display information about the activities.
My problem is that, buttons are generated, but the picturebox that is supossed to use as background is always on top of the buttons (setting its visibility to false show me the cute buttons).
I tryed everything I know, googled a lot, and I have no idea how to make this work. I'd like to use picturebox but if it's impossible, I'll set the background image on form (primarirly because picturebox image automatically repaints). I'd like to try picturebox way.
SendToBack and BringToFront do nothing with z-order. Picturebox always remains on top.
- Controls are placed on a panel, so the picturebox.
This is being developed in .NET 2.0 and there is no way to use WPF.
I haven't any fresh brain cell to think about it... all of them fried the whole afternoon with the giant code (and it isn't ended yet, hehehe). Thanks in advance to everyone that waste his time reading my post.
Saludos.
Ing Rosell |