'Dibujar Calendario
Dim dmin As Integer = FCalMin.Dia, xref As Double = FCalMin.value * Kt - R_Cal.X
Dim dMax As Integer = FscrMax.Dia
Dim ktd As Double = Kt * 1440 'Pixels por día
y0 = R_Cal.Y : y1 = R_Cal.Bottom - 2 : x = R_Cal.X
g.FillRectangle(Brushes.White, R_Cal)
DrawHline(g, y1) 'Línea inferior
DrawHline(g, R_GrAct.Bottom) 'Línea inferior
x -= 1 : g.DrawLine(Pens.Black, x, y0, x, y1)
'x -= 2 : g.DrawLine(Pens.Black, x, y0, x, y1) 'Izda Calendario
Dim x0 As Integer = R_Cal.X, x1 As Integer
ta.Alignment = StringAlignment.Center
For d As Integer = dmin To dMax
x1 = CInt((d + 1) * ktd - xref) 'If d < dMax Then .... Else x1 = R_Cal.Right
x = (x0 + x1) \ 2
g.DrawLine(Pens.Black, x1, y0, x1, y1)
Dim dw As Integer = Calend.DayOfWeek(d), br As Brush = Brushes.Black
If caljla.Festivo(d) Then br = Brushes.Red Else _
If dw = DayOfWeek.Saturday Then br = Brushes.Blue
n = d - FechaInicio.Dia 'Ordinal - Día de Project
If n >= 0 Then n += 1
s = n.ToString
If (s.Length * tw) < (x1 - x0) Then g.DrawString(s, Font, br, x, Yd1, ta)
s = Calend.DiaToDate(d).Day.ToString
If (s.Length * tw) < (x1 - x0) Then g.DrawString(s, Font, br, x, Yd0, ta)
x0 = x1
Next
|