[已解决] C#中的MaskedTextbox高度? [英] [Solved] MaskedTextbox Height in C#?

查看:185
本文介绍了[已解决] C#中的MaskedTextbox高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

任何机构都可以通过代码窗口知道如何增加Maskedtextbox的高度吗?

我已经尝试通过增加DesignSource和代码中的高度来实现,但是MaskedTextbox的高度保持不变.

问候,
帕湾.


OP更新:
MaskedTextbox,Textbox的常用功能

Hi All

Could any body know how to increase the height of Maskedtextbox through code window?

i have tried by increasing the height in DesignSource as well as in code.but MaskedTextbox height remains unchange.

Regards,
Pawan.


UPDATE from OP:
Common Function For MaskedTextbox,Textbox

private void ControlHeightWidth()
         {
               foreach (Control c in this.Controls)
               {
                     if ((c.GetType() == typeof(MaskedTextBox)))
                     {
                           ((MaskedTextBox)c).AutoSize = false;
                           c.Size = new Size(130, 30);
                     }
                     if ((c.GetType() == typeof(TextBox)))
                     {
                           ((TextBox)c).AutoSize = false;
                           c.size=new Size(100,30);
                     }
               }
         }

推荐答案

将AutoSize属性设置为false并更改高度(不是在设计时而是在代码中)

祝你好运.
set the AutoSize property to false and change the height (not at design time but in code)

Good luck.


这篇关于[已解决] C#中的MaskedTextbox高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆