Calendar Year Spinner

Components on the Raize Widgets palette: calendars, time pickers, calculators, color pickers, property stores, launchers, tray icons, balloon hints, etc.

Calendar Year Spinner

Postby MikeQuizzer » Tue Nov 07, 2017 1:55 pm

Hello Ray,

Back again with another Calendar query.
You told another User about using the Spinner component to change the displayed Year.
Could you provide a piece of code to demonstrate how to sync a label caption with the year as the spinner changes it?
I've tried putting some code in an OnViewDateChange event without success.

Thanks

Mike
MikeQuizzer
 
Posts: 4
Joined:
Mon Oct 02, 2017 1:04 pm

Re: Calendar Year Spinner

Postby Raize Support » Sun Nov 19, 2017 3:33 pm

Hi Mike,

I apologize for the delay. I'm not sure if this is precisely what you are trying to accomplish, but I created a new VCL project and dropped a TRzCalendar and a TRzLabel onto the form. I then wrote the following event handler for the RzCalendar1.OnViewDateChange event:

Code: Select all
procedure TForm12.RzCalendar1ViewDateChange(Sender: TObject; ViewDate: TDateTime);
begin
  RzLabel1.Caption := DateToStr( ViewDate );
end;


When I run the app, I can then click on the Year value in the calendar and the spinner control becomes visible and I when I use the spinner to change the year, the label component is updated appropriately.

Hope this helps,
Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 603
Joined:
Fri Mar 25, 2011 9:04 pm

Re: Calendar Year Spinner

Postby MikeQuizzer » Mon Nov 20, 2017 12:45 pm

Thanks Ray,

I had almost got that but not the viewdate bit.
Great stuff.

Mike
MikeQuizzer
 
Posts: 4
Joined:
Mon Oct 02, 2017 1:04 pm


Return to Widgets

Who is online

Users browsing this forum: No registered users and 2 guests

cron