Windows Forms to HTML and Blazor using ChatGPT 4o
-
It occurred to me the other day that Chat GPT might be able to convert a C# WinForms form to HTML, or at least it would be interesting to try. ChatGPT 4o[^] seems to be a bit improved over ChatGPT 4. I would not be surprised others have tried the same. So, I created a simple Windows Form, with some labels, textboxes, a drop-down list, a checkbox and a button. I then uploaded the contents of the Form1.cs, Form1.designer.cs, and Form1.resx files to the chat, and asked it to return the code for an HTML page. I also asked it to return a Blazor razor component page. It did a pretty good job. Not perfect, but for trying to convert the UI portion of a WinForms application, it could save time from simply manually doing the conversion. I did not try anything complicated, and I would not expect it to translate the C# code to code for Blazor, but I plan to experiment further. Since this forum is not for programming questions, I am hesitant to provide files, but you should be able to replicate the process yourself. For those interested, it might make an interesting thread.