vb.net中的高级文本框合并

vb.net中的高级文本框合并,vb.net,textbox,merge,Vb.net,Textbox,Merge,有没有一种方法可以像这样合并文本框: textbox1 : O N E textbox2 : T W O 因此,当我合并它时,它看起来像: 您应该为文本框文本创建一个循环 Function MyMerge(byval string1 as string, byval string2 as string) as string Dim x as Integer iif(string1.Length >= String2.Length, String2.Length, String1.Leng

有没有一种方法可以像这样合并文本框:

textbox1 : O N E
textbox2 : T W O
因此,当我合并它时,它看起来像:


您应该为文本框文本创建一个循环

Function MyMerge(byval string1 as string, byval string2 as string) as string
Dim x as Integer iif(string1.Length >= String2.Length, String2.Length, String1.Length )
For i as Integer = 1 to x
  MyMerge &= iif(string1.length >= x, string1.substring(i-1,1),"") 
  MyMerge &= iif(string2.length >= x, string2.substring(i-1,1),"")
Next

End Function 
因此,您可以通过

Msgbox(MyMerge(TextBox1.Text, TextBox2.Text))

你应该为你的文本框做一个循环

Function MyMerge(byval string1 as string, byval string2 as string) as string
Dim x as Integer iif(string1.Length >= String2.Length, String2.Length, String1.Length )
For i as Integer = 1 to x
  MyMerge &= iif(string1.length >= x, string1.substring(i-1,1),"") 
  MyMerge &= iif(string2.length >= x, string2.substring(i-1,1),"")
Next

End Function 
因此,您可以通过

Msgbox(MyMerge(TextBox1.Text, TextBox2.Text))

你为什么不在文本框中连接字符来创建你自己的sub?它总是像“ONETWO”一样合并,而不是像我想要的。你为什么不在文本框中连接字符来创建你自己的sub?它总是像“ONETWO”一样合并,而不是像我想要的。它只是“文本混合器”。一个人在文本框1和文本框2中都写单词,一个按钮应该合并这两个文本框。我刚刚添加了return(mymerge),它现在可以工作了。谢谢你的时间。它只是一个“文本混合器”。一个在textbox1和textbox2中写单词的按钮应该合并这两个文本框。我刚刚添加了return(mymerge),它现在可以工作了。谢谢你的时间。