Question : Ho Do you Create a timeline Planner/diary in vb.net

HI I want to create a timeline to show the events for the day. I have no idea where to start or how to go about it. I thought may be a graph but I want people to be able to drag and drop zoom in and out.
I have only made database form apps so this one will be a learning curve. But if someone could point me in the right direction and give any suggestions that would be great.
 
This is what I want to create
314709
 

Answer : Ho Do you Create a timeline Planner/diary in vb.net

A time line is a rectangle, then using:
    g.FillRectangle(hb, r)   where  - g - Graphics, Hb - Brush,   r - rectangle

To eval rectangle coordinates, you need
   DateScrMin, DateScrMax -    Date limits for screen area. When zoom you change limits.
   Dim Kt  as Single =  (DateScrMax.ticks  - DateScrMin.ticks) / WidthScreenArea

  Now for interval  Date1-Date2:
      xDate1 =  ScreenArea.Left + Kt * (Date1.ticks - DateScrMin.ticks)
      barWidth= Kt * (Date2.ticks  - Date1.ticks)

The sample code to draw Calendar header, draws Moth day and Project day.
It uses red color for Sunday and holydays, Blue for Saturday.
In this code, I do´n use Date Type, I use FechaCpm  Type   (minutes)  Date.Ticks / Timespan.ticksPerMinute
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
 '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
Random Solutions  
 
programming4us programming4us