I ended up with this and it works perfectly... I later shade the filled in
calendar with dated entries from an application. The builtin calendar really
lacks in visual formatting.
Sub PopulateCalendar(ByVal MyDate As Date)
Dim s As String = ""
Dim lbl As Label = Nothing
Call ClearText()
Dim d As New DateTime(MyDate.Year, MyDate.Month, 1)
Dim iDaysInMonth As Short =
CShort(System.DateTime.DaysInMonth(d.Year, d.Month))
Dim iDay As Integer = 1
Dim StartDay As Integer = d.DayOfWeek
StartLabel = "Label" & StartDay + 1
For i As Integer = StartDay + 1 To iDaysInMonth + StartDay
s = "Label" & CStr(i)
lbl = CType(GrpCal.Controls(s), Label)
lbl.Text = CStr(iDay)
iDay = iDay + 1
Next i
End Sub
Thank you for the replies...
"Herfried K. Wagner [MVP]" <hirf-spam-me-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Am 15.05.2010 23:47, schrieb Paul Ilacqua:
>> How can create a loop to fill a manual calendar IE
>> For i as integer = 0 to 31
>> TextBox &i.Text = yadayada ' Where Textboes are named Textbox1, Textbox2
>> etc
>> Next i
>
> \\\
> Dim TextBoxes() As TextBox = {Me.TextBox1, Me.TextBox2, ...}
> For Each TextBox As TextBox in TextBoxes
> TextBox.Text = ...
> Next TextBox
> ///
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
|