Memo

TsgcHTMLComponent_Memo — 一个多行文本区输入,带有标签、可配置的行数和数据集绑定,渲染 Bootstrap 5 textarea,适用于 Delphi、C++ Builder 和 .NET。

TsgcHTMLComponent_Memo

一个独立的多行输入,发出带标签的 Bootstrap <textarea>。设置名称、标签和行数,然后读取 HTML 属性。它与同级的 Edit、CheckBox 和 RadioGroup 输入位于同一单元中。

组件类

TsgcHTMLComponent_Memo

渲染为

Bootstrap 5 <textarea>

语言

Delphi, C++ Builder, .NET

创建它、配置它、渲染它

设置 NameLabel_RowsPlaceholder,然后读取 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),控制文本区的初始高度。

状态

RequiredDisabledReadOnly 为输入框标记验证和编辑状态。

数据集绑定

DataField 加上已赋值的 DataSource 会从当前记录填充 Value

输出与同级

HTML 返回带标签的 <textarea>。同一单元声明了同级的 TsgcHTMLComponent_EditTsgcHTMLComponent_CheckBoxTsgcHTMLComponent_RadioGroup 输入。

继续探索

所有 sgcHTML 组件浏览 60 多个组件的完整功能矩阵。
下载免费试用版30 天试用版附带 60.HTML 演示项目。
价格Single、Team 和 Site 授权,均含完整源代码。

准备好开始了吗?

下载免费试用版,开始在 Delphi、C++ Builder 和 .NET 中构建 Web 界面。