What's happening is very simple; keep in mind that at compile-time there are no
instances of either: your Form; its Controls; or the Classes defined within it (nested Classes).
And, your internal Classes have no inheritance relationship with Form1 that would give them access to its contents, like the Controls on the Form. The fact a Class is defined within another Form, or Class, does not mean it has a 'Parent.
The compiler tries to create the 'DoublyLinkedList Class, and finds no usable reference to an instance of the 'txtOutput TextBox, so it produces the error you see.
Even though your
defining an EventHandler within your nested Class doesn't cause a compile error: you can't set an EventHandler at design-time for the Click Event of 'btnExecute because it is not visible in the Property Browser. You'd have to set the EventHandler in code, which you don't do.
The "fix" is easy: move the code for the Click EventHandler of 'btnExecute so it's inside Form1, not inside the Class 'DoublyLinkedLists.
And after you do that, you'll need to make some other adjustments:
private void btnExecute_Click(object sender, EventArgs e)
{
DoublyLinkedList dll = new DoublyLinkedList();
dll.AddNode("Tom");
dll.AddNode("Jack");
dll.AddNode("Mary");
dll.AddNode("Meir");
dll.AddNode("Toxic");
dll.Find("Meir");
txtOutput.Text = dll.PrintNode();
}
Note that the call to dll.Remove is commented out: it will cause an error because in your code for DoublyLinkedList you are not handling the case where the "previous" node of a "current" node is 'null.
Note also that your 'Find method returns a 'Node, and 'Remove returns a 'string: that you don't
use what is returned will not cause an error, but I suggest you learn the habit of always using what methods you create return; or, make the methods return 'void.
fyi: if you wish to "go nuts" thinking about the difference between using 'String and 'string: [
^].