form wont open, says something about a method not found

Go down

form wont open, says something about a method not found

· #1

when i open my form in lazarus it gives an error that a method in the form file was not found, something about Button3Click

the form used to open fine. i did not change anything. (i deleted some code i wasnt using)

Re: form wont open, says something about a method not found

· #2

I have the exact same problem! Following this thread.

Re: form wont open, says something about a method not found

· #3

nvm fixed it

Re: form wont open, says something about a method not found

· #4

Oh great! How?

Re: form wont open, says something about a method not found

· #5

Hello? How did you fix it?

Re: form wont open, says something about a method not found

· #6

He's gone. They always go. Somewhere there is a graveyard of threads that end in "nvm fixed it", and one day I'm going to find the person who can explain all of them.

Pete · thirty years of begin and end "It compiled on my machine."

Re: form wont open, says something about a method not found

· #7

I'll write the answer he didn't, so the next person who searches for this finds something.

The form file (.lfm) says "Button3's OnClick is Button3Click". The code deleted earlier was Button3Click. So the form points at a method that no longer exists.

Lazarus notices when you open the form and offers to repair it by removing the dangling reference. Say yes. Or fix it by hand:

  1. Right-click the form, View Source (.lfm).
  2. Find the line OnClick = Button3Click and delete it.
  3. Switch back to the form.

To avoid it next time, clear the event in the Object Inspector before deleting the method. An empty handler is also removed automatically when you save.

Read the error message. Then read it again.

Re: form wont open, says something about a method not found

· #8

That was it. Thank you for being the kind of person who comes back.

Re: form wont open, says something about a method not found

· #9

oh yeah thats what i did. the yes button

Re: form wont open, says something about a method not found

· #10

Rule 9: "nvm fixed it" must be followed by how. I'm running out of numbers.

Forum rules 1 to 10 apply. Yes, to you.

Go up

Sign in to reply