InputGroup

TsgcHTMLComponent_InputGroup — renderizza un input Bootstrap con testo addon anteposto e posposto (ad esempio $.00 o @username), in Delphi, C++ Builder e .NET.

TsgcHTMLComponent_InputGroup

Un componente di input che emette un input-group Bootstrap con testo addon anteposto e posposto opzionale attorno a un form-control. Imposta i testi e l’input, quindi leggi la proprietà HTML.

Classe del componente

TsgcHTMLComponent_InputGroup

Renderizza

Bootstrap 5 input-group markup

Famiglia

Moduli e Campi

Linguaggi

Delphi, C++ Builder, .NET

Crealo, aggiungi gli addon, renderizzalo

Imposta PrependText/AppendText e le proprietà dell’input, quindi leggi HTML — oppure chiama l’helper statico Build per una soluzione a riga singola.

uses
  sgcHTML_Enums, sgcHTML_Component_InputGroup;

var
  oGroup: TsgcHTMLComponent_InputGroup;
begin
  oGroup := TsgcHTMLComponent_InputGroup.Create(nil);
  try
    oGroup.PrependText := '$';
    oGroup.AppendText := '.00';
    oGroup.InputName := 'amount';
    oGroup.InputTypeEnum := itNumber;
    oGroup.Placeholder := '0';
    oGroup.Size := igsLarge;

    WebModule.Response := oGroup.HTML;   // <div class="input-group">...
  finally
    oGroup.Free;
  end;
end;

// Or the static one-liner (prepend, name, placeholder, append):
Result := TsgcHTMLComponent_InputGroup.Build('@', 'user', 'username');
// includes: sgcHTML_Enums.hpp, sgcHTML_Component_InputGroup.hpp

TsgcHTMLComponent_InputGroup *oGroup = new TsgcHTMLComponent_InputGroup(NULL);
try
{
  oGroup->PrependText = "$";
  oGroup->AppendText = ".00";
  oGroup->InputName = "amount";
  oGroup->InputTypeEnum = itNumber;
  oGroup->Placeholder = "0";
  oGroup->Size = igsLarge;

  String html = oGroup->HTML;   // <div class="input-group">...
}
__finally
{
  delete oGroup;
}

// Or the static one-liner:
String html = TsgcHTMLComponent_InputGroup::Build("@", "user", "username");
using esegece.sgcWebSockets;

var group = new TsgcHTMLComponent_InputGroup();
group.PrependText = "$";
group.AppendText = ".00";
group.InputName = "amount";
group.InputTypeEnum = TsgcHTMLInputType.itNumber;
group.Placeholder = "0";
group.Size = TsgcHTMLInputGroupSize.igsLarge;

string html = group.HTML;   // <div class="input-group">...

// Or the static one-liner:
string html2 = TsgcHTMLComponent_InputGroup.Build("@", "user", "username");

Proprietà e metodi principali

I membri che utilizzerai più spesso.

Addon

PrependText renderizza un addon input-group-text iniziale; AppendText ne renderizza uno finale. Lascia uno dei due vuoto per ometterlo.

Input

InputName, InputValue e Placeholder popolano il form-control interno; InputType imposta la stringa grezza del tipo HTML.

Tipo di input

InputTypeEnum (TsgcHTMLInputType) sceglie itText, itEmail, itNumber, itPassword, itTel e altri senza scrivere a mano la stringa del tipo.

Dimensionamento

Size (TsgcHTMLInputGroupSize) sceglie igsDefault, igsSmall o igsLarge per aggiungere il modificatore Bootstrap input-group-sm/-lg.

Helper statico

Build(prepend, inputName, placeholder, append) — e un overload che accetta un TsgcHTMLInputType — restituisce il markup in una riga senza gestire un’istanza.

Output

HTML restituisce il <div> input-group completo; GroupID ne imposta l’attributo id per scripting o stile.

Continua a esplorare

Tutti i componenti sgcHTMLEsplora la matrice completa delle funzionalità di oltre 60 componenti.
Scarica la Prova GratuitaLa prova di 30 giorni include i progetti demo 60.HTML.
PrezziLicenze Single, Team e Site con codice sorgente completo.

Pronto a Iniziare?

Scarica la versione di prova gratuita e aggiungi input group alla tua app web in Delphi, C++ Builder o .NET.