c# - Verifying Controls on a Windows Form -


i have windows written in c# , wanted verify data in each control (dropdown, textbox, etc) not null before saving data database. have multiple forms in application. how go doing it? thinking create boolean function.

you can write simple method loop through controls in form , check control values.

    private bool checkcontrols()     {         foreach (control ctrl in this.controls)         {            //write code check whether control value null             //case: testbox return true;             //case: dropdown return true;             //case: listbox return true;             //..etc          }         return false;     } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -