VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,580 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello experts,
Any idea why this public function is not accessible in other forms?
Public Declare Function SetThreadExecutionState Lib "kernel32" (ByVal esFlags As EXECUTION_STATE) As EXECUTION_STATE
Public Enum EXECUTION_STATE
ES_AWAYMODE_REQUIRED = &H40
ES_SYSTEM_REQUIRED = &H1
ES_DISPLAY_REQUIRED = &H2
ES_CONTINUOUS = &H80000000
End Enum
So this usage is OK?
Form1.SetThreadExecutionState(Form1.EXECUTION_STATE.ES_CONTINUOUS)
or it's better to use the whole above code as private in each form?
Thanks :)
Place it in a code module in your project and use it from there.