AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Klassennamen ändern

Ein Thema von Marco Steinebach · begonnen am 20. Aug 2024 · letzter Beitrag vom 27. Aug 2024
 
Kas Ob.
Online

Registriert seit: 3. Sep 2023
458 Beiträge
 
#9

AW: Klassennamen ändern

  Alt 20. Aug 2024, 13: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
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz