使所有TextBoxes UPPERCASE

时间:2016-01-28 10:06:53

标签: c# winforms

有没有办法可以在df = df[~((df.a.str.contains('number')) | (df.a.str.contains('code')))] df1 = df[df.c.isnull()] df1 = df1[['a', 'b']].reset_index(drop=True) df1.columns = ['number','amount'] #if all numbers are integers df1 = df1.astype(int) print df1 number amount 0 10 34 1 23 65 2 54 7 3 40 674 4 73 2365 5 210 4534 6 2343 4565 df2 = df[df.c.notnull()].reset_index(drop=True) df2.columns = ['code','volume', 'dim'] #if all numbers are integers df2 = df2.astype(int) print df2 code volume dim 0 1 56 34 1 23 57 565 2 341 3456 6534 3 23 957 908565 大写中设置所有TextBoxes。 我一直在做的是

Form

1 个答案:

答案 0 :(得分:0)

您可以获取Form的Controls集合中的所有TextBox控件,并将CharacterCasing属性设置为CharacterCasing.Upper

foreach(var tb in this.Controls.OfType<TextBox>())
{
    tb.CharacterCasing = CharacterCasing.Upper;
}