Programmatically Differentiate Between Design Mode and Run Time

Programmatically Differentiate Between Design Mode and Run Time

This code enables and/or disables functions during design andtesting. The code can remain during initial deployment withoutaffecting the end user. Make sure the path string being searchedis part of your project path and is not in your final application’sdirectory:

 If InStr(App.Path, "VB") Then        ' Set Test Locations        ' Modify Settings without changing         ' ini or registry settings        ' Defeat security        ' Set optionsEnd If'A simple variant of this technique isIf InStr(App.Path, "VB") Then Stop

You can insert this during debugging, but if you forget, it won’tcause users problems.


About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist