钥匙问题 [英] problem in keys

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

问题描述

我在应用程序中使用了以下代码来制作加速键.它将起作用,但是问题是当页面加载时,按钮显示名称"button1"而不是文本("login").我将其分配给属性.请忽略我的错误.

I used the following code in my application for making accelerated keys. It will work but the problem is when the page load the button shows the name "button1" instead of the text ("log in"). I assigned it in property. Please ignore my mistake.

string buttonName = "button1";
string buttonShortcut = "B";
buttonName = Regex.Replace(buttonName, buttonShortcut, "&" + buttonShortcut, RegexOptions.IgnoreCase);
button1.Text = buttonName;

推荐答案

为什么您的按钮在运行时需要更改名称?

为什么要使用Regex而不是stringbuilder?

为什么不在表单加载事件中这样做?
Why does your button need to change name at runtime?

Why are you using Regex instead of a stringbuilder?

Why not do this in the form load event?


这篇关于钥匙问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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