如果我单击一个选项按钮,文本框将显示标签 [英] if i click one option button the textbox will visible with label

查看:75
本文介绍了如果我单击一个选项按钮,文本框将显示标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我单击选项按钮文本框将显示标签...如何为此编写代码...请发布回答

if i click option button textbox will visible with label...how to write code for that...please post answer

推荐答案

转到的特性你的textBox和你的标签,并将案例可见切换为假,然后在你的选项按钮点击事件中尝试这个:

Go to the proprities of your textBox and your label and switch the case "visible" to "false", then try this in your option button click event:
private void yourOptionButton_Click(object sender, EventArgs e)
       {
           yourTextBox.Visibility = true;
           yourLabel.Visibility = true;
       }


如果你想在该文本框中显示一些预定义值作为标签而不是

你可以使用文本框直接作为标签工作,单击按钮后意味着不可编辑的文本框。



例如,如果你在某些字符串中获得某些其他文本框的值。 />


string str = txtbox2.text.ToString();



并且想要将该值作为标签放在其他文本框中,



您可以使用。



If you want to show some predefine values in that textbox as a label than
You can use the textbox directly to work as a label, mean uneditable textbox after clicking on button.

for example if you are getting value of some other textbox in some string like.

string str = txtbox2.text.ToString();

and want to put that value as label in other textbox than,

You may use.

private void Increment_Click(object sender, EventArgs e)
       {
           string str = txtbox2.text.ToString();
           txtIncrement.text = str ;
           txtIncrement.Visibility = true;
           txtIncrement.enabled = false;
       }







很抱歉,如果我不理解你的逻辑,但希望如此gona帮助你至少..





问候,

:)




Sorry if i didnt understand your logic well, but hope so that it gona help you a bit atleast..


Regards,
:)


这篇关于如果我单击一个选项按钮,文本框将显示标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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