Thread: Kylix and Memos

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    3
    Rep Power
    0

    Question Kylix and Memos


    Hi,

    I have a kylix program which does Memo1.Undo; which works great but when I bring it over to Delphi compiler I get Memo1.Undo is undeclared identifier heres the code I am using:

    unit Unit1;

    interface

    uses
    SysUtils, Types, Classes, Variants, QTypes, QGraphics, QControls, QForms,
    QDialogs, QStdCtrls;

    type
    TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.xfm}

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Memo1.Undo;
    end;

    end.

    thanks alot
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Ah yes, I think you have to use SendMessage and send an EM_UNDO message to Memo.Handle instead.
    Something like this ought to do the trick:
    SendMessage(Memo.Handle, EM_UNDO, 0, 0);
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo