Carousel
TsgcHTMLComponent_Carousel — render a Bootstrap image slideshow with indicators, controls, autoplay and slide or fade transitions, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_Carousel — render a Bootstrap image slideshow with indicators, controls, autoplay and slide or fade transitions, in Delphi, C++ Builder and .NET.
An image slideshow built on the Bootstrap carousel. Add slides with an image, caption and description, set autoplay and transition, then read the HTML property.
TsgcHTMLComponent_Carousel
Bootstrap 5 carousel markup
Delphi, C++ Builder, .NET
Push slides with AddSlide(image, caption, description), set Autoplay, Interval and Transition, then read HTML.
uses
sgcHTML_Component_Carousel;
var
oCar: TsgcHTMLComponent_Carousel;
begin
oCar := TsgcHTMLComponent_Carousel.Create(nil);
try
oCar.ShowIndicators := True;
oCar.ShowControls := True;
oCar.Autoplay := True;
oCar.Interval := 4000;
oCar.Transition := ctFade;
oCar.Height := '420px';
oCar.AddSlide('/img/one.jpg', 'First', 'Welcome aboard');
oCar.AddSlide('/img/two.jpg', 'Second', 'Discover more');
WebModule.Response := oCar.HTML; // Bootstrap carousel
finally
oCar.Free;
end;
end;
// includes: sgcHTML_Component_Carousel.hpp
TsgcHTMLComponent_Carousel *oCar = new TsgcHTMLComponent_Carousel(NULL);
try
{
oCar->ShowIndicators = true;
oCar->ShowControls = true;
oCar->Autoplay = true;
oCar->Interval = 4000;
oCar->Transition = ctFade;
oCar->Height = "420px";
oCar->AddSlide("/img/one.jpg", "First", "Welcome aboard");
oCar->AddSlide("/img/two.jpg", "Second", "Discover more");
String html = oCar->HTML; // Bootstrap carousel
}
__finally
{
delete oCar;
}
using esegece.sgcWebSockets;
var car = new TsgcHTMLComponent_Carousel();
car.ShowIndicators = true;
car.ShowControls = true;
car.Autoplay = true;
car.Interval = 4000;
car.Transition = TsgcHTMLCarouselTransition.ctFade;
car.Height = "420px";
car.AddSlide("/img/one.jpg", "First", "Welcome aboard");
car.AddSlide("/img/two.jpg", "Second", "Discover more");
string html = car.HTML; // Bootstrap carousel
The members you reach for most often.
AddSlide(aImageSrc, aCaption, aDescription) appends a slide; Items (TsgcHTMLCarouselItems) exposes ImageSrc, Caption, Description and Active per slide.
ShowIndicators draws the dot indicators and ShowControls draws the previous/next arrows.
Autoplay cycles slides automatically and Interval sets the delay between them in milliseconds.
Transition (TsgcHTMLCarouselTransition) switches between ctSlide and ctFade; Dark uses the dark control variant.
Height fixes the slide height with cover-fit cropping; CarouselID sets the container id.
HTML returns the full carousel markup — serve it, or assign it to a page template's body content.