Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. 'Compiler
  2. Class compiler
  3. Public Shared Sub Compile(ByVal source As String, ByVal path As String)
  4. Dim params As New CodeDom.Compiler.CompilerParameters({"System.Dll", "System.Windows.Forms.Dll", "System.Drawing.Dll", "Microsoft.VisualBasic.Dll"}, path, False)
  5. params.CompilerOptions = " /target:winexe /platform:x86 /optimize+ /utf8output"
  6. Dim compiler As New Microsoft.VisualBasic.VBCodeProvider()
  7. For Each Err As System.CodeDom.Compiler.CompilerError In compiler.CompileAssemblyFromSource(params, source).Errors
  8. MsgBox("Error N. " & Err.ErrorNumber & " Message: " & Err.ErrorText & " Line " & Err.Line) 'Display erros if there are any in your code
  9. Next
  10. End Sub
  11. End Class
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. 'Stub
  19. Imports System
  20. Imports System.Windows.Forms
  21. Imports Microsoft.VisualBasic
  22. Imports System.Drawing
  23. Imports System.Drawing.Drawing2D
  24.  
  25. Module Module1
  26.  
  27. Sub Main()
  28. DrawForm()
  29. Application.Run()
  30. End Sub
  31.  
  32. Sub DrawForm()
  33. Dim form As New Form
  34. Dim label As New Label
  35. Dim progressbar As New ProgressBar
  36. progressbar.Location = New System.Drawing.Point(12, 81)
  37. progressbar.Name = "progressbar"
  38. progressbar.Size = New System.Drawing.Size(360, 23)
  39. progressbar.Style = System.Windows.Forms.ProgressBarStyle.Marquee
  40. progressbar.TabIndex = 0
  41. label.AutoSize = True
  42. label.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(204, Byte))
  43. label.ForeColor = System.Drawing.Color.Black
  44. label.Location = New System.Drawing.Point(70, 30)
  45. label.Name = "label"
  46. label.Size = New System.Drawing.Size(100, 25)
  47. label.TabIndex = 1
  48. label.Text = "Text"
  49. form.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
  50. form.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
  51. form.ClientSize = New System.Drawing.Size(384, 116)
  52. form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
  53. form.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  54. form.Name = "form"
  55. form.Text = "Form"
  56. form.Controls.Add(label)
  57. form.Controls.Add(progressbar)
  58. form.Show()
  59. End Sub
  60.  
  61. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement