c# - How to add an extra properties argument to a textbox? -


i have winforms textboxes. each textbox show setting values .ini file. of .ini file values encrypted , require values decrypted before placing value inside textbox. created function:

storeinivaluetovar(string inisection, string inikey, bool? encrypt) 

is possible extend textbox properties custom argument such boolean? encrypt? thinking pass custom argument boolean? encrypt value storeinivaluetovar function.

there's generic property called tag. can store kind of strings in it. disadvantage return type object, don't have derive ui control.

example:

    private void ontextboxchanged(object sender, eventargs e)     {         var updatedtextbox = sender textbox;         object tagobject = updatedtextbox.tag;          // further converting of tag here...      } 

set events of textboxes (here textchanged) 1 single eventhandler , can textbox instance , tag well.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -