Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Compiler
- Class compiler
- Public Shared Sub Compile(ByVal source As String, ByVal path As String)
- Dim params As New CodeDom.Compiler.CompilerParameters({"System.Dll", "System.Windows.Forms.Dll", "System.Drawing.Dll", "Microsoft.VisualBasic.Dll"}, path, False)
- params.CompilerOptions = " /target:winexe /platform:x86 /optimize+ /utf8output"
- Dim compiler As New Microsoft.VisualBasic.VBCodeProvider()
- For Each Err As System.CodeDom.Compiler.CompilerError In compiler.CompileAssemblyFromSource(params, source).Errors
- MsgBox("Error N. " & Err.ErrorNumber & " Message: " & Err.ErrorText & " Line " & Err.Line) 'Display erros if there are any in your code
- Next
- End Sub
- End Class
- 'Stub
- Imports System
- Imports System.Windows.Forms
- Imports Microsoft.VisualBasic
- Imports System.Drawing
- Imports System.Drawing.Drawing2D
- Module Module1
- Sub Main()
- DrawForm()
- Application.Run()
- End Sub
- Sub DrawForm()
- Dim form As New Form
- Dim label As New Label
- Dim progressbar As New ProgressBar
- progressbar.Location = New System.Drawing.Point(12, 81)
- progressbar.Name = "progressbar"
- progressbar.Size = New System.Drawing.Size(360, 23)
- progressbar.Style = System.Windows.Forms.ProgressBarStyle.Marquee
- progressbar.TabIndex = 0
- label.AutoSize = True
- label.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(204, Byte))
- label.ForeColor = System.Drawing.Color.Black
- label.Location = New System.Drawing.Point(70, 30)
- label.Name = "label"
- label.Size = New System.Drawing.Size(100, 25)
- label.TabIndex = 1
- label.Text = "Text"
- form.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
- form.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- form.ClientSize = New System.Drawing.Size(384, 116)
- form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
- form.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
- form.Name = "form"
- form.Text = "Form"
- form.Controls.Add(label)
- form.Controls.Add(progressbar)
- form.Show()
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement