Link to home
Start Free TrialLog in
Avatar of Michael Sterling
Michael SterlingFlag for United States of America

asked on

Undeclared Identifier

i've got an elementary question, so elementary that i'm almost afraid to ask,..but i gotta do what i gotta do...i'm trying to customize the CreateMessageDialog function from the Dialogs unit. I've copied and pasted the function into my code and renamed it CreateMyMessageDialog. I have included the Dialogs unit in my uses clause. When i try to compile my code i get this error:

[Error] SwipeForm.pas(xxx): Undeclared identifier: 'TMessageForm'

on this line:

Result := TMessageForm.CreateNew(Application);

which is pretty much the first line of code in the function (snippet included), so what am i doing wrong


function TfrmSwipeEntry.CreateMyMessageDialog(const Msg: string; DlgType: TMsgDlgType;
  Buttons: TMsgDlgButtons): TForm;
const
  mcHorzMargin = 8;
  mcVertMargin = 8;
  mcHorzSpacing = 10;
  mcVertSpacing = 10;
  mcButtonWidth = 50;
  mcButtonHeight = 14;
  mcButtonSpacing = 4;
var
  DialogUnits: TPoint;
  HorzMargin, VertMargin, HorzSpacing, VertSpacing, ButtonWidth,
  ButtonHeight, ButtonSpacing, ButtonCount, ButtonGroupWidth,
  IconTextWidth, IconTextHeight, X, ALeft: Integer;
  B, DefaultButton, CancelButton: TMsgDlgBtn;
  IconID: PChar;
  TextRect: TRect;
begin
  Result := TMessageForm.CreateNew(Application); <--error happens here
  .
  .
  .
end;

Open in new window

Avatar of ThievingSix
ThievingSix
Flag of United States of America image

Add "Dialogs" to your uses clause.


Avatar of Michael Sterling

ASKER

its in there,..i mentioned that in the description...also my ultimate goal here is to change the size of the MessageDlg window. I've got the font changed but now the window itself is too small for the font and i need to change the size of it...
Ah, I completely missed it. Your going to have to import the TMessageForm type and all it's methods to your unit as well because TMessageForm isn't publicly declared in dialogs.
ok,...i was wondering if i'd have to do that, but didn't understand why,..until now. thanks.
ASKER CERTIFIED SOLUTION
Avatar of ThievingSix
ThievingSix
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i think i like the last suggestion better,..its less work... ;-)