Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.17 KB | None | 0 0
  1.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         VR.Add(TextBox2.Text) 'Text Box de    nome
  3.         VR.Add(ComboBox1.Text) 'Text Box de    tipo
  4.         VR.Add(TextBox3.Text) 'Text Box de    usando
  5.  
  6.  
  7.         Dim finalT As String = GeralTF
  8.         Dim i As Int16 = 0
  9.         For Each regexi As System.Text.RegularExpressions.Regex In V
  10.             finalT = regexi.Replace(finalT, VR(i))
  11.             i += 1
  12.         Next
  13.         RichTextBox1.Text = finalT
  14.     End Sub
  15.  
  16.     Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
  17.         Dim GeralTF As String = ""
  18.         Dim V As New List(Of System.Text.RegularExpressions.Regex)
  19.         Dim VR As New List(Of String)
  20.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
  21.         GeralTF = RichTextBox1.Text
  22.  
  23.         'O que substituir
  24.         V.Add(New System.Text.RegularExpressions.Regex("{nome}"))
  25.         V.Add(New System.Text.RegularExpressions.Regex("{tipo}"))
  26.         V.Add(New System.Text.RegularExpressions.Regex("{usando}"))
  27.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement