0

I have an application which is developed in c# WinForms. Now i am developing an another application using ReactJS and Electron. I am able to do that and i have generated EXE successfully.

Now i dont want to run both the applications as separate applications. So i docked ReactJS and Electron generated EXE inside a form container of existing WinForm application. I used this article to achieve that- Docking Window inside another Window

Now EXE is running inside WinForm but i am facing some issues in UI rednering. See that attached screenshot. Application is not properly.

Is it right way to do it? Does anybody has experience in this? What kind of other problems i am going to face in future?

enter image description here

ManishKumar
  • 1,476
  • 2
  • 14
  • 22
  • 1
    You might encounter better results if you show your react app inside a webbrowser that is intended to be embedded inside a winforms exe (which is a different thing to showing one exe inside another).. Like the gecko project (firefox embeddable .net component). https://stackoverflow.com/questions/8778320/how-to-use-gecko-in-c-sharp - the problem this has though is that it needs the gecko team to release new Geckos when firefox updates.. I think they got to Gecko60, whereas firefox is approx version 75 atm ? Could also look at CefSharp and DotNetBrowser - embeddable chromium variants for .net – Caius Jard Jul 10 '20 at 07:25
  • The only thing I'm confused about is why you're bothering with the outer exe at all; the whole idea of electron is that you can write a web app, embed it inside/run it with electron and then that whole thing becomes your EXE. Skype, for example, is now an electron app, and I think teams is too... https://stackoverflow.com/questions/40615837/how-to-compile-an-electron-application-to-a-exe – Caius Jard Jul 10 '20 at 07:28
  • Actually we already have a desktop app running and we dont want to do everything from scratch. But we want to move to new technologies. So if we can write every new functionality in new tech then gradually we will move everything on new tech stack. While doing this, we dont want our clients to feel like they are two separate applications. That's why we need to merge them together @CaiusJard. And thanks for the link but we have already created exe from electron.js I think the option you suggested looks good. Let me read more about gecko – ManishKumar Jul 10 '20 at 07:31
  • 1
    Also take a look at whether using MDI will cause some problems; try doing the same thing without using it and see if it resolves any issues. MDI has always brought some quirks and strange behaviors (but I couldn't give an exhaustive list as to what they are) – Caius Jard Jul 10 '20 at 07:39
  • Dont you think i should use Web Browser from Windows Toolkit instead of gecko? @CaiusJard – ManishKumar Jul 10 '20 at 10:22
  • 1
    It depends. I could say "yes, because that's what I recommended orginally when I said 'use a web browser component that is intended to be embedded' " - just because i said "like gecko" does not mean "it must be gecko". My advice was to use an ebeddable web browser, which WebView is. *HOWEVER*, you may not be aware that WebView is EdgeHTML, also known as "old Edge" - Edge has switched to using chromium and microsoft are rolling out "new Edge" and WebView is now deprecated. WebView2 (which I suspect is chromey) is coming, but for now I would *recommend* you **don't** use WebView specifically – Caius Jard Jul 10 '20 at 10:38
  • Okay, thanks for the insight @CaiusJard – ManishKumar Jul 11 '20 at 06:17

0 Answers0