Public Function not accessible in other forms?

OSVBNET 1,386 Reputation points
2022-05-27T21:37:29.577+00:00

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?

  • Update: using it on other forms does not work, no effect, pretty confused :(

Thanks :)

VB
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
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful