Forcing a NumericUpDown control to only accept powers of two

前端 未结 4 846
天涯浪人
天涯浪人 2021-01-16 03:51

I present the user a NumericUpDown control so he can specify the size of a texture. It is important that this texture is of power of two size (32, 64, 128...).

I hav

4条回答
  •  温柔的废话
    2021-01-16 04:45

    You're going to run into a problem in 2+ digit numbers. If I want to put 32 and you see the 3 as I am typing, then your program would just tell me I'm wrong. Validate it when you submit your data.

提交回复
热议问题