Advertisement
Guest User

Untitled

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