Calendar
TsgcHTMLComponent_Calendar — render a month-grid calendar with coloured event dots, a today highlight and previous/next navigation, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_Calendar — render a month-grid calendar with coloured event dots, a today highlight and previous/next navigation, in Delphi, C++ Builder and .NET.
Set the Year and Month, add events on specific days (or bind a dataset), then read the HTML property.
TsgcHTMLComponent_Calendar
Bootstrap 5 card with a month-grid <table>
Delphi, C++ Builder, .NET
Set Year and Month, push a few Events.Add entries with a Day, Title and Color, then read HTML.
uses
sgcHTML_Component_Calendar;
var
oCal: TsgcHTMLComponent_Calendar;
oEvt: TsgcHTMLCalendarEvent;
begin
oCal := TsgcHTMLComponent_Calendar.Create(nil);
try
oCal.Year := 2026;
oCal.Month := 6;
oCal.HighlightToday := True;
oCal.ShowNavigation := True;
oEvt := oCal.Events.Add;
oEvt.Day := 12;
oEvt.Title := 'Release';
oEvt.Color := '#7C3AED';
WebModule.Response := oCal.HTML; // card + month-grid table
finally
oCal.Free;
end;
end;
// Or bind it straight to a dataset:
oCal.LoadFromDataSet(qryEvents, 'EventDate', 'Subject');
// includes: sgcHTML_Component_Calendar.hpp
TsgcHTMLComponent_Calendar *oCal = new TsgcHTMLComponent_Calendar(NULL);
try
{
oCal->Year = 2026;
oCal->Month = 6;
oCal->HighlightToday = true;
oCal->ShowNavigation = true;
TsgcHTMLCalendarEvent *oEvt = oCal->Events->Add();
oEvt->Day = 12;
oEvt->Title = "Release";
oEvt->Color = "#7C3AED";
String html = oCal->HTML; // card + month-grid table
}
__finally
{
delete oCal;
}
using esegece.sgcWebSockets;
var cal = new TsgcHTMLComponent_Calendar();
cal.Year = 2026;
cal.Month = 6;
cal.HighlightToday = true;
cal.ShowNavigation = true;
var evt = cal.Events.Add();
evt.Day = 12;
evt.Title = "Release";
evt.Color = "#7C3AED";
string html = cal.HTML; // card + month-grid table
The members you reach for most often.
Year and Month select the grid; they default to the current month, and GetMonthName drives the heading.
Events holds items with a Day, Title, hex Color and enum ColorStyle; each event renders as a coloured dot under its day.
LoadFromDataSet(aDataSet, aDateField, aTitleField) creates one event per row that falls inside the current month and year.
ShowNavigation with PrevURL and NextURL renders previous/next links; NavButtonClass styles them.
HighlightToday marks the current day using the classes in TodayClass.
TableClass, EventDotSize and CalendarID tune the table styling and dot size.