文字框中的字符显示 [英] Char display in text box

查看:172
本文介绍了文字框中的字符显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问你如何在文本框或Windows窗体应用程序的其他任何地方显示定义的char的值,net 3.0框架工作?
就像;

private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e)
         {
             int i=35;
             textBox1->Text = i.ToString();
         }


就像上面的示例一样,它显示整数值,就像我要分配一个char并在文本框中显示其值一样.
喜欢;

 {
                    char a[10]="David";
                    textbox1->=Text=a;
}


此编码一定是错误的,但我希望您理解我的意思,我想在文本框中显示char"a"的值.
请帮帮我.我是初学者,需要您的帮助. = " ; textbox1-> Text = name;



-SA


.text属性采用字符串值而不是数组.
您应该这样做:

Textbox1.text = new string(a);


I wanna ask you that how can I display the value of a defined char in text box or anywhere else in windows form application,,net 3.0 frame work?
just like;

private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e)
         {
             int i=35;
             textBox1->Text = i.ToString();
         }


just like in above example, it displays the value of integer, just like that i want to assign a char and display its value in textbox.
like;

 {
                    char a[10]="David";
                    textbox1->=Text=a;
}


This coding must be wrong, but I hope u understand my meaning, I want to display the value of char ''a'' in text box.
Please help me out. I am a beginner and needs your help.

解决方案

String name = "David";
textbox1->Text = name;



—SA


.text property takes string value and not an array.
You should rather do it like:

Textbox1.text = new string(a);


这篇关于文字框中的字符显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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