August 24th, 2010, 06:13 PM
Scheduler design questions - need input
I have a weekly schedule that has the control structure as shown by this captured picture link.
The rectangles are Control Borders located inside a Grid. My grid is 1 row, 2 columns. The time lines within the border are done by drawing lines using the Line method. This is the only way I could figure out how to place the lines at absolute pixel locations. When the user presses the Update Schedule button, I fill in each 15 minute block with Red (for ON) or White (for OFF) depending on the user schedule selection. I use the Line method once again to 'fill in' each 15 block. I tried to use the rectangle method, but it didn't have a way to draw at a particular coordinate within the grid. Does anyone have a better method to use?
Also, how do you release Line objects? I've noticed that with each Update Schedule press, the update time takes longer and longer. I think because the resources are never released and are taking up stack space. With each 15 minute block, I create 6 Lines and I think those 6 Lines stay as objects as long as the window is active. So, how do I resolve this? Do I need to create 4032 Line objects (7 days * 96 intervals * 6 per interval) and just update them as I need to? It seems as though there is a better way. But, I need absolute coordinate control. It would probably be better to draw a rectangle and fill it in, but again I can't seem to get coordinate control.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!