switching forms lazarus / 9-Editor ---------------------------------------------------------------------- ryskka · 2014-01-25 23:52 Hi, i've been making a Snake game and now i want to make a menu. I've made a new form "Menu" and in procedure "on click" i wrote this:  Code: [Select]      Form1.Left:=Form2.Left;     Form1.Top:=Form2.Top;     Form1.Show;  but when i want to compile it says "identifier not found: Form1" (Form1 is my game, Form 2 is Menu). i've tried to put the Unit 1 to uses in menu but it won't work. Any suggestions? pleasee? ---------------------------------------------------------------------- taazz · 2014-01-26 00:06 erm I assume that unit1 has the TForm1 class and unit2 has the Tform2 class. You have already added the unit2 in the unit1 uses clause to be able to call it haven't you? In that case why don't you put the code you showed as in unit1 instead of unit2 it should work. In case that you haven't added in the uses clause of unit1 the unit2 then you need to added otherwise you can't access the form2 variable. Please keep in mind that form1, form2 are global variables that are given values automatically when the forms are auto created. If they are not auto created then the values those variables have are invalid and it will lead to problems at run time.