Cntr = 0
offsetY = 125
offsetX = 40
Width = 40
Height = 30
Dim Done As Boolean
Done = False
For y = 0 To DaysInMonth - 1
If y = 0 Then
For x = 7 - FirstNode To 6
Cntr = Cntr + 1
b.Initialize("b")
MainForm.RootPane.AddNode(b, offsetX + x * (Width + 5dip), offsetY, Width, Height)
b.Font = fx.DefaultFont(14)
b.Text = Cntr
b.Tag = Cntr
b.Id = Cntr
Next
Else
For x = 0 To 6
Cntr = Cntr + 1
b.Initialize("b")
MainForm.RootPane.AddNode(b, offsetX + x * (Width + 5dip), offsetY + y * (Height + 5dip), Width, Height)
b.Font = fx.DefaultFont(14)
b.Text = Cntr
b.Tag = Cntr
b.Id = Cntr
If Cntr = DaysInMonth Then
Done = True
Exit
End If
Next
End If
If Done = True Then Exit
Next