your procedure is not part of the class Form1.
either:
1) write in the declaration of Form1 (or whatever name your form is)
Form1=Class(TForm)
...
protected
Procedure DisplayMessageBox;
and then
Procedure TForm1.DisplayMessageBox;
That way the procedure knows all the things that are part of the Form (like the timer)
2)
write
Form1.Timer1.Enabled
but that's less good, as you access Form1 => a global variable.... => and global variables should be avoided