Memo
TsgcHTMLComponent_Memo — 一个多行文本区输入,带有标签、可配置的行数和数据集绑定,渲染 Bootstrap 5 textarea,适用于 Delphi、C++ Builder 和 .NET。
TsgcHTMLComponent_Memo — 一个多行文本区输入,带有标签、可配置的行数和数据集绑定,渲染 Bootstrap 5 textarea,适用于 Delphi、C++ Builder 和 .NET。
一个独立的多行输入,发出带标签的 Bootstrap <textarea>。设置名称、标签和行数,然后读取 HTML 属性。它与同级的 Edit、CheckBox 和 RadioGroup 输入位于同一单元中。
设置 Name、Label_、Rows 和 Placeholder,然后读取 HTML(或将其放入 TsgcHTMLTemplate_Bootstrap 页面)。
uses
sgcHTML_Component_Edit;
var
oMemo: TsgcHTMLComponent_Memo;
begin
oMemo := TsgcHTMLComponent_Memo.Create(nil);
try
oMemo.Name := 'notes';
oMemo.Label_ := 'Notes';
oMemo.Rows := 6;
oMemo.Placeholder := 'Anything we should know?';
oMemo.Value := 'Initial text';
WebModule.Response := oMemo.HTML; // Bootstrap textarea
finally
oMemo.Free;
end;
end;
// Or bind it to a dataset field:
oMemo.DataField := 'Notes';
oMemo.DataSource := dsCustomer;
// includes: sgcHTML_Component_Edit.hpp
TsgcHTMLComponent_Memo *oMemo = new TsgcHTMLComponent_Memo(NULL);
try
{
oMemo->Name = "notes";
oMemo->Label_ = "Notes";
oMemo->Rows = 6;
oMemo->Placeholder = "Anything we should know?";
oMemo->Value = "Initial text";
String html = oMemo->HTML; // Bootstrap textarea
}
__finally
{
delete oMemo;
}
using esegece.sgcWebSockets;
var memo = new TsgcHTMLComponent_Memo();
memo.Name = "notes";
memo.Label_ = "Notes";
memo.Rows = 6;
memo.Placeholder = "Anything we should know?";
memo.Value = "Initial text";
string html = memo.HTML; // Bootstrap textarea
您最常使用的成员。
Name 设置字段名称,Label_ 设置可见标题,MemoID 设置元素 id(默认为 memo_<Name>)。
Value 为文本区内容预设内容,Placeholder 在其为空时显示占位文本。
Rows 设置可见行数(默认 4),控制文本区的初始高度。
Required、Disabled 和 ReadOnly 为输入框标记验证和编辑状态。
DataField 加上已赋值的 DataSource 会从当前记录填充 Value。
HTML 返回带标签的 <textarea>。同一单元声明了同级的 TsgcHTMLComponent_Edit、TsgcHTMLComponent_CheckBox 和 TsgcHTMLComponent_RadioGroup 输入。