Registriert seit: 3. Sep 2023
353 Beiträge
|
AW: Klassennamen ändern
20. Aug 2024, 14:15
Yes, interposer did the job, while keeping the Window Class name as TRichEdit, so Screen Reader or any inspector application will see that.
example
Code:
unit uMain;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.ComCtrls,
Vcl.StdCtrls, uMyRichEdit;
type
TForm10 = class(TForm)
RichEdit1: TRichEdit; // if uMyRichEdit not the last in uses clauses then "uMyRichEdit.TRichEdit" should be used
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form10: TForm10;
implementation
{$R *.dfm}
end.
Code:
unit uMyRichEdit;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.ComCtrls;
type
//TMyRichEdit = class; // foreward declaration
TRichEdit = class( Vcl.ComCtrls.TRichEdit)
protected
procedure KeyPress(var Key: Char); override;
end;
//TMyRichEdit = class(uMyRichEdit.TRichEdit); // just naming override, will work for runtime creation only and for internal naming usage
implementation
{ TRichEdit }
procedure TRichEdit.KeyPress(var Key: Char);
begin
Key := '*';
inherited;
end;
end.
Kas
|
|
Zitat
|