Cience
✅ console.writeline not working on Winforms application
I attempted to use this post to help me https://stackoverflow.com/questions/4362111/how-do-i-show-a-console-output-window-in-a-forms-application use a console on a WinForms application but the output will not show, I have read over the "Duplicate questions" page and they all don't answer my question
I've tried using Debug. WriteLine but it doesn't work either. I'm assuming I'm missing a setting of some sort but they all say "use Managed Compatibility Mode" but its been gone for years, I'm having it open the console on a button press, and it opens the console it just won't output anything I've also tried "FreeConsole()" but it doesn't even open.
78 replies
❔ not all code paths return a value
this code
im like 99% sure i need a return statement and without
Mouse Hook says "not all code paths return a value"
but when i add the return statement the error goes away with a new one on the "return;"
an object of type convertible to "IntPtr" is required, can someone show me how to fix this?
public IntPtr MouseHook(int left, int top)
{
SetCursorPos(left, top);
hookId = Hook(process);
return;
}
6 replies
✅ Detect holding mouse from in and outside the form
this here https://stackoverflow.com/questions/49068445/c-sharp-detect-mouse-clicks-anywhere-inside-and-outside-the-form
is the general concept but it only works on singular mouse clicks, here is a base example
and if the mouse button is released the code stops i cant really explain stuff well so if you need to know more please ask
using WPF, Visual studio 2022.
```csharp
if(Mouse button is held down anywhere)
{
Runcode();
}
if(mouse button is released)
{
StopRuncode();
}
40 replies