Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

7 day calendar for showing hourly schedules

Status
Not open for further replies.
Oct 2, 2002
104
US
I'm trying to display 10 hours in 15 minute increments on a vb.net form.
For instance...

2:00
2:15
2:30
2:45
3:00
3:15
.......all the way up to
11:00
11:15
11:30
11:45
12:00

I'd like to have each of these values be linkable to a database I've got, it holds movie scheduling information.

AND, I'd like to be able to show 7 days on the form at any given time.

The idea is that a theatre manager could use this interface to schedule a weeks worth of movies.

Not sure how to approach this.

Are listboxes a good idea? I suppose I could have 40 buttons (10 hours x the 15 minute intervals) all next to each other, but this seems tedious.

The database just holds a start time for a movie, and the length...
Ideally, I'd like to have this schedule be "blocked off" after a movie is scheduled... so they don't overlap, etc.


Any general suggestions for how to build a calendar like this, what type of controls to use, etc?

I can use a dtaetimepicker to select a given date without issue, but I still need to be able to show big blocks of a schedule at once, and am at a loss as to how to approach this.

Thanks all.
 
Check out the control made by this company:


This allows you to create a Gantt Chart, with as many rows as you need, and do all sorts of cool stuff with it. We bought a license for this thing where I work... and it's really reliable. We're using it in a manufacturing scheduling program. You can download a sample version with one of those annoyance screens... it's fully functional though, so you can see how it works.

Ben

Ben
A programmer was drowning. Lots of people watched but did nothing. They couldn't understand why he yelled "F1!"
 
This looks awesome.
But I'm really just trying to find something simple.

Anybody ever made a simple calendar from scratch?
 
You could generate your own using the System.Drawing package and the Paint Event in your form.

Pick a width and height for your rectangles then just loop drawing rectangles to the screen based on the day number and the hour/block number, color them one color for open and one color for closed.
You could probably encapsulate the whole thing in an pbject with functions to add shows for a single day or multiple days at certain times with certain lengths of showing, then have a master array that kept track of wherther each half-hour block was open or closed.
Catching a mouse event gives you the mouse coordinates, then you would simply floor(mousePosition.X/block_width) and same for height to figure out which block was clicked on.

Dunno, sometimes I make things more complicated then they need to be :p

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top