CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    25

    Border vs. Rectangle

    I'm creating a Schedule app. within a grid. Should I use a Border or Rectangle to make the Schedule?

    Currently, I'm using a Border with 'tick marks' on the 15, 30, 45 mins of each hour of the day. The problem I'm having is placing the border at a specific location within the grid. Can someone tell me what the syntax of the HorizontalAlignment parameter is. I can't get the syntax correct.

    Also, would a rectangle be better? It seems to have the same problem with HorizontalAlignment in that I can't get the syntax correct to place it at a particular location within the grid.

    Sutton

  2. #2
    Join Date
    Mar 2004
    Posts
    25

    Re: Border vs. Rectangle

    Well, I figured out the Horizontal and Vertical Alignment problem, but still haven't figured out whether Border or Rectangle is the best approach. Both seem to work the same.

    However, it looks like I have to create 7 rectangle objects (one for each day of the week schedule). If I have 96 'tick' Lines on each rectangle for 15 minute interval dividers, do I have to create 96 * 7 Line objects to display? Seems like there should be a better way.

  3. #3
    Join Date
    Jan 2007
    Posts
    491

    Re: Border vs. Rectangle

    What's the problem with creating 96*7 lines? you don't have to draw them manually... all you gotta do is to draw one rectangle inside two for loops.
    Code:
    for(int i=0;i<7;i++)
    {
        for(int j=0;j<96;j++)
        {
            //Draw a rectangle, starting at point (i*DAY_WIDTH, j*15)
        }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured