You can block the textbox of some input characters

xiaoxiao2021-03-04  64

Class mytextbox: system.windows.Forms.textBox {protected override bool processKeyEventArgs (ref Message M) {Int S = m.wpaam.toint32 (); if (m.msg == 0x0102) {ix (((S <48) | (s> 57)) // This is a character (ASCII) return true;} return base.processKeyEventArgs (REF M);}}

The reason why the reason why we can intercept the ProcessKey event, but the characters have been entered in. It is difficult to achieve the effect of shielding (even if the mask is not really shielded, but the input is completed and then deleted.)

转载请注明原文地址:https://www.9cbs.com/read-31737.html

New Post(0)