我有大约30按钮,每个按钮包含文本,然后一个数字,我只是需要把其他按钮的数量按钮名称最后一个字母
比如上例中button1.Name应该TEST3
这可能吗?
我知道,这样的LastIndexOf不起作用,这给了我想做的adchieve
button1 = "hello1"; //this varies in normal program
button2 = "notimportant3"; //this varies in normal program
button1.Name = "test"+button2.Name.LastIndexOf(1);
你试过了吗? – LukeHennerley 2013-03-20 12:25:58
我不认为LastIndexOf在这里使用得当 – Yahya 2013-03-20 12:28:30