(GoBack,GoForward,etc.) Controls from Form1 to Form2

Joined
Aug 11, 2021
Messages
5
Programming Experience
Beginner
Hi
I want to make a WebBrowser.
Dont ask why i want it to make how i want it.
The buttons (GoBack,GoForward,etc.) should be on Form1.
The webBrowser is on Form2.
How can i controll the webBrowser from Form1?
Please help
Thx
 
Let Form1 expose events when the buttons are pressed. Let Form2 subscribe to those events.
 
Out of curiosity, are you really making a true web browser from the ground up? Or are you just hosting the built in WebBrowser control, or one of the Chromium browsers? If you are truly building browser from the ground up, kudos on you for taking on this massive project.

In general, though, if taking on this massive project in a brand new code base, I would recommend doing it in any other framework other than WinForms. Although MS extended the life of WinForms by re-introducing it back into .NET Core 3.1, I would still treat it as if it were an end-of-life technology. Choose WPF. Choose UWP. Choose Xamarin. Anything but WinForms.
 
Out of curiosity, are you really making a true web browser from the ground up? Or are you just hosting the built in WebBrowser control, or one of the Chromium browsers? If you are truly building browser from the ground up, kudos on you for taking on this massive project.

In general, though, if taking on this massive project in a brand new code base, I would recommend doing it in any other framework other than WinForms. Although MS extended the life of WinForms by re-introducing it back into .NET Core 3.1, I would still treat it as if it were an end-of-life technology. Choose WPF. Choose UWP. Choose Xamarin. Anything but WinForms.
Im using a built in WeBrowser (webBrowser1)
 
You can follow the Blog link in my signature below and check out my post on Custom Events. That will show you how to declare and raise an event in Form1. You might have BackButtonClick and ForwardButtonClick events in the form and raise them when the Click events of the corresponding Buttons are raised.
 
Back
Top Bottom