Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.11 KB | None | 0 0
  1. Public Class Form3
  2.     Dim GeralTF As String = "" Dim V As New List(Of System.Text.RegularExpressions.Regex) Dim VR As New List(Of String)
  3.     Private Sub bemvindo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bemvindo.Click
  4.  
  5.     End Sub
  6.  
  7.     Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
  8.         Application.ExitThread()
  9.     End Sub
  10.  
  11.     Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
  12.         Me.WindowState = FormWindowState.Minimized
  13.     End Sub
  14.  
  15.     Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click
  16.         Form1.Show()
  17.         Me.Hide()
  18.     End Sub
  19.  
  20.     Private Sub body_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles body.Paint
  21.  
  22.     End Sub
  23.  
  24.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  25.         VR.Add(TextBox2.Text) 'Text Box de    nome
  26.         VR.Add(ComboBox1.Text) 'Text Box de    tipo
  27.         VR.Add(TextBox3.Text) 'Text Box de    usando
  28.  
  29.  
  30.         Dim finalT As String = GeralTF
  31.         Dim i As Int16 = 0
  32.         For Each regexi As System.Text.RegularExpressions.Regex In V
  33.             finalT = regexi.Replace(finalT, VR(i))
  34.             i += 1
  35.         Next
  36.         RichTextBox1.Text = finalT
  37.     End Sub
  38.  
  39.     Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
  40.         Dim GeralTF As String = ""
  41.         Dim V As New List(Of System.Text.RegularExpressions.Regex)
  42.         Dim VR As New List(Of String)
  43.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
  44.         GeralTF = RichTextBox1.Text
  45.  
  46.         'O que substituir
  47.         V.Add(New System.Text.RegularExpressions.Regex("{nome}"))
  48.         V.Add(New System.Text.RegularExpressions.Regex("{tipo}"))
  49.         V.Add(New System.Text.RegularExpressions.Regex("{usando}"))
  50.     End Sub
  51. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement