aboutdemoform.pas

来自「胜天进销存源码,国产优秀的进销存」· PAS 代码 · 共 79 行

PAS
79
字号
unit AboutDemoForm;

interface

{$I ..\cxVer.inc}


uses
  Windows, Messages, SysUtils, Classes, Controls, Forms, StdCtrls,
  cxControls, cxContainer, cxEdit, cxTextEdit, cxMemo, cxRichEdit;

type
  TformAboutDemo = class(TForm)
    redDescription: TcxRichEdit;
  public
    constructor Create(const ADescription: string); reintroduce;
  end;

procedure ShowAboutDemoForm;

implementation

{$R *.dfm}

{$IFDEF DELPHI6}
uses
  Types;
{$ENDIF}  

var
  FForm: TformAboutDemo;

procedure ShowAboutDemoForm;
var
  ADescription: TStringList;
begin
  if FForm = nil then
  begin
    ADescription := TStringList.Create;
    try
      ADescription.LoadFromFile(ExtractFilePath(Application.ExeName) + 'About.txt');
      FForm := TformAboutDemo.Create(ADescription.Text);
    finally
      ADescription.Free;
    end;
  end;
  FForm.Show;
end;

constructor TformAboutDemo.Create(const ADescription: string);

  procedure AssignBounds;
  var
    ADesktopArea: TRect;
    AOffset: Integer;
  begin
    Left := Application.MainForm.BoundsRect.Right;
    Top := Application.MainForm.BoundsRect.Top;
    Height := Application.MainForm.Height;
    ADesktopArea := GetDesktopWorkArea(Point(Left, Top));
    if BoundsRect.Right > ADesktopArea.Right then
    begin
      AOffset := BoundsRect.Right - ADesktopArea.Right;
      Left := Left - AOffset;
      if Application.MainForm.Left > AOffset then
        Application.MainForm.Left := Application.MainForm.Left - AOffset
      else
        Application.MainForm.Left := 0;
    end;
  end;

begin
  inherited Create(Application);
  AssignBounds;
  redDescription.Lines.Text := ADescription;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?