Hack Forums
[C#] Using Console App Code in Windows Forms? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Using Console App Code in Windows Forms? (/showthread.php?tid=6105924)



Using Console App Code in Windows Forms? - District - Aug 29, 2020

I am making a trainer for the game Assault Cube as it is my first real C# project. Using VAMemory I can read and write the memory addresses to change stuff like health/ammo. I want to use this code in my Windows Form so that it'll modify the addresses on a button click event.

Check the picture in my spoiler for a possibly better explanation.

Spoiler (Click to View)
Apparently I need to pass vam to Form1.cs or subscribe to the events in Program.cs, but I have absolutely no idea how to do either or even understand why this needs to be done. Searching the docs helped me a little but I'm still really stuck... :(


RE: Using Console App Code in Windows Forms? - Accord - Aug 29, 2020

Are you trying to do some design pattern?? if not then just copy the code from main and put it on the button accordingly..


RE: Using Console App Code in Windows Forms? - District - Aug 29, 2020

(Aug 29, 2020 06:18 AM)Accord Wrote:  Are you trying to do some design pattern?? if not then just copy the code from main and put it on the button accordingly..

No design pattern. I just really want to learn how to do it. I tried moving the code from main into the form and it just gave me a bunch of other problems.