Advertisement
hiro1357

VB.NET Form Application Skeleton

Dec 2nd, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. ---make.bat---
  2. @echo off
  3. for /f "usebackq" %%d in (`dir/w %WINDIR%\Microsoft.NET\Framework ^| findstr [v`) do set dotnetdir=%%d
  4. set dotnetdir=%dotnetdir:[=%
  5. set dotnetdir=%dotnetdir:]=%
  6. rem echo %dotnetdir%
  7. set VBCOMPILER=%windir%\Microsoft.NET\Framework\%dotnetdir%\vbc.exe
  8.  
  9. %VBCOMPILER% /target:winexe /main:App /platform:anycpu /out:skeleton.exe Main.vb Form1.vb
  10. pause
  11. ---end make.bat---
  12.  
  13. ---Main.vb---
  14. Imports System
  15. Imports System.Windows.Forms
  16.  
  17. Public Class App
  18. <STAThread()> _
  19. Shared Sub Main()
  20. Application.EnableVisualStyles()
  21. Application.Run(New Form1)
  22. End Sub
  23. End Class
  24. ---end Main.vb---
  25.  
  26. ---Form1.vb---
  27. Imports System
  28. Imports System.Windows.Forms
  29.  
  30.  
  31. Public Class Form1
  32. Inherits Form
  33.  
  34. Public WithEvents Button1 As Button
  35.  
  36. Public Sub New()
  37. Button1 = New Button
  38. Button1.Top = 10
  39. Button1.Left = 10
  40. Button1.Text = "hello"
  41. Me.Controls.Add(Button1)
  42. End Sub
  43.  
  44. Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
  45. MessageBox.Show("hello")
  46. End Sub
  47.  
  48. End Class
  49. ---end Form1.vb---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement