Results 1 to 4 of 4

Thread: [RESOLVED] create calendar with msflexgrid flexgrid grid control

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2013
    Posts
    16

    Resolved [RESOLVED] create calendar with msflexgrid flexgrid grid control

    Name:  calendar.jpg
Views: 2488
Size:  33.4 KB please finish for me or help. No need for years. January, March, May, July, August, October, December have 31 days. September, April, June, November have 30 days.
    Code:
    Private Sub Form_Load()
        Dim C As Integer
        Dim R As Integer
    
        cboMonth.AddItem "January"
        cboMonth.AddItem "February"
        cboMonth.AddItem "March"
        cboMonth.AddItem "April"
        cboMonth.AddItem "May"
        cboMonth.AddItem "June"
        cboMonth.AddItem "July"
        cboMonth.AddItem "August"
        cboMonth.AddItem "September"
        cboMonth.AddItem "October"
        cboMonth.AddItem "November"
        cboMonth.AddItem "December"
        
        cboDay.AddItem "Monday"
        cboDay.AddItem "Tuesday"
        cboDay.AddItem "Wednesday"
        cboDay.AddItem "Thursday"
        cboDay.AddItem "Friday"
        cboDay.AddItem "Saturday"
        cboDay.AddItem "Sunday"
        
        MSFlexGrid1.Rows = 6
        MSFlexGrid1.Cols = 7
        MSFlexGrid1.FixedCols = 0
        
        For C = 0 To MSFlexGrid1.Cols - 1
           MSFlexGrid1.ColWidth(C) = 600
        Next C
        For R = 0 To MSFlexGrid1.Rows - 1
            MSFlexGrid1.RowHeight(R) = 600
        Next R
        
        With MSFlexGrid1
            .Row = 0
            .Col = 0
            .Text = "Mon"
            .Col = 1
            .Text = "Tue"
            .Col = 2
            .Text = "Wed"
            .Col = 3
            .Text = "Thu"
            .Col = 4
            .Text = "Fri"
            .Col = 5
            .Text = "Sat"
            .Col = 6
            .Text = "Sun"
        End With
    End Sub
    Last edited by firezap; Jan 21st, 2013 at 08:38 PM.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: create calendar with msflexgrid flexgrid grid control

    What do you need help with? We can not do the whole project for you.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2013
    Posts
    16

    Re: create calendar with msflexgrid flexgrid grid control

    how do i put numbers 1 to 31 across

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: create calendar with msflexgrid flexgrid grid control

    Like this
    "vb" Code:
    1. .Row = 1
    2.  .Col = 0
    3.  .Text = 1
    4.  .Row = 1
    5.  .Col = 1
    6.  .Text = 2
    7.  .Row = 1
    8.  .Col = 2
    9.  .Text = 3

    Although, you need to figure out how to connect the month to how many days it has so the correct number of days for each month is displayed because not every month has 31 days

    Edit:

    I have done it for you.

    vb Code:
    1. Option Explicit
    2.   Dim days As Integer, i As Integer
    3. Private Sub cmdSetup_Click()
    4.  Dim c As Integer
    5.     Dim r As Integer
    6.     With MSFlexGrid1
    7.           .Row = 1
    8.           .Col = 6
    9.           End With
    10.         Select Case cboMonth
    11.         Case "January"
    12.          days = 31
    13.         Case "February"
    14.          days = 28
    15.         Case "March"
    16.          days = 31
    17.         Case "April"
    18.          days = 30
    19.         Case "May"
    20.          days = 31
    21.         Case "June"
    22.          days = 30
    23.         Case "July"
    24.          days = 31
    25.         Case "August"
    26.          days = 31
    27.         Case "September"
    28.          days = 30
    29.         Case "October"
    30.          days = 31
    31.         Case "November"
    32.          days = 30
    33.         Case "December"
    34.          days = 31
    35.         End Select
    36.         With MSFlexGrid1
    37.          For i = 1 To days
    38.           .Text = i
    39.            If .Col = 6 Then
    40.              .Row = .Row + 1
    41.              .Col = 0
    42.              Else
    43.               .Col = .Col + 1
    44.            End If
    45.          Next i
    46.         End With
    47. End Sub
    Last edited by Nightwalker83; Jan 21st, 2013 at 09:47 PM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Tags for this Thread

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