我有一个名为textbox1
的整数,这个id在每个按钮点击时获得不同的值(例如101)。只要单击该按钮,我就希望将这些值连接到以逗号分隔的101,102,103
:With Selection.Find
.Text = "^m^m": .Replacement.Text = "^m": .Forward = True: .Wrap = wdFindContinue: .Format = False: .MatchCase = False: .MatchWholeWord = False: .MatchKashida = False: .MatchDiacritics = False: .MatchAlefHamza = False: .MatchControl = False: .MatchWildcards = False: .MatchSoundsLike = False: .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
答案 0 :(得分:0)
我想我知道你的意思。这应该像你期望的那样工作:
public void Button_Click(object sender, EventArgs e)
{
if(string.IsNullOrEmpty(textBox.Text)
{
textBox.Text = Id;
}
else
{
textBox.Text += "," + Id;
}
}