unit ControlsGetShortHint;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ComCtrls;

type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    Edit1: TEdit;
    StatusBar1: TStatusBar;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: ControlsGetShortHint
// Routine: Controls.GetShortHint

// BeginCode
{
This code assigns a two-part string to the Hint property
of an edit box and then displays the "short" or first part
of the string as the text of the edit box.
This example requires a button, a test edit and a statusbar.
Set the AutoHint property and the SimplePanel property to
True for the statusbar.  Set the ShowHint property to True
for the text edit and the form.
Notice that the short hint is used for the text edit hint
and the long hint is used for the statusbar.
}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  Edit1.Hint := 'Name|Enter full name';
  Edit1.Text := GetShortHint(Edit1.Hint);
end;
// EndCode
// EndExample: ControlsGetShortHint
end.
