Refresh canvas (defaultCanvas) in run-time.

Your project worked for me when I selected the Time Change option.

Ah, sorry i forget that i bought Time ctrl and Date ctrl plugins, RB in this time have not .
I tried with VB6 .ocx DateTimePicker does not run properly under xojo (windows).
Any way, it is running for time change.
I was using :

Dim d as New Date

extracting time by :
hrs = d.Date.Hours
mn = d.Date.Minutes
ss = d.Date.Seconds

Instead of :
hrs = TimeCtrl.Hour
mn= TimeCtrl.Minute
ss = TimeCtrl.Second
Thank you Kevin and others.

[quote=396686:@Djamel AIT AMRANE]Kevin,
Unlike to textchange, timeCtrl change does not respond.
an example is attached this msg.[/quote]

Hello,
come back to refresh drawing on canvas.
I discover that the problem is coming from the DateTime Picker (Einhugur plugin).
When changing other input data (SkyMap) it means when changing the position
(latitude and longitude) of observer the sky (stars) are moving well “textchange”.
using simple Textfield and textchange event for hours, minutes,
and seconds instead of Date Time Picker (Einhugur plugin) the problem disappear.
Any one has experience with Einhugur Date time picker ?
I tried to use Microsoft DateTime Picker (ActiveX Component) with out succeed !

[quote=396360:@Eugene Dakin]HI Djamel,

Usually Canvas.Invalidate is the correct call to try and refresh an image that is drawn on the canvas.

I am going to guess that your drawing code is in the Canvas.Paint event, and looks something like this:

Sub Paint(g As Graphics, areas() As REALbasic.Rect) Handles Paint 'Draw the picture to the graphics layer If PBuffer <> Nil then g.DrawPicture(PBuffer,0,0,me.Width, me.Height, 0,0, PBuffer.Width, PBuffer.Height) End If 'Draw a rectangle around the canvas g.DrawRect(0,0,me.Width, me.Height) End Sub

This takes a picture called PBuffer and draws it to the canvas.

If you want to update the picture based on time, then redraw the new PBuffer picture from the new time, and then call the Canvas1.Invalidate to update the picture in the canvas to the user.

[code]//Make changes to date/time
//change variables to draw your new picture based on the time
//Once the new picture has been drawn for your new time then
//call Canvas1.invalidate to shown the new picture on the canvas:

Canvas1.invalidate
[/code]

I hope this helps :)[/quote]
Eugene,
I am sure now that the Canvas.Refresh problem is done by my DTPicker Time (plugin).
Drawing is displayed properly when time or date are introduced via textfield.text and textfield textChange Event.