I need to modify the Form's Clientsize in a static function but I get a compiler error - error C2597: illegal reference to non-static member 'System::Windows::Forms::Form::ClientSize. Are there any workarounds? Thanks.

Recommended Answers

All 2 Replies

You probably either need to make the function non-static or the member data static.

There is no way to access non-static data from a static member function without an instance of the class to operate on.

How do I make ClientSize static?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.