c# - How to keep DRY when I need to overload a method for all of my forms? -


on of c# forms, have following code:

protected override createparams createparams {         {         const int ws_ex_toolwindow = 0x80;          createparams cp = base.createparams;         cp.exstyle |= ws_ex_toolwindow;         return cp;     } } 

how remove each of forms , keep code clean?

what base class inherits form , overrides whole createparams property. then, rest of concrete forms inherits customform.

any form within application share createparams implementation and, if of them requires specific implementation, override in concrete class enough! ;)


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -