This is a recreation of my first program I wrote back in 2008 when I was in Grade 9. It is written in Visual Basic 6 and had a grand total of 8 lines. It was an “hard to close” prank program.
You can download it from here.
How to (Re) Create My First Program?
First create a new project with Standard EXE.
Then in the Properties window change “Borderstyle” to “1 – Fixed Single” , “ControlBox” to “False”. You can change the caption and rename the form if you want. I’ve change the caption to “Close Me If You Can!” and renamed the form “frmMain”. End result should look like this.
Then place two CommandButtons on the form and rename them to “btn1” and “btn2”. Change the Caption to “Click me to close the window!”. Change the “Visible” property of “btn2” to “False.”
Double click on one button to open the code of the form. Change the procedure from “Click” to “MouseMove”. Add the following code to btn1_MouseMove.
Private Sub btn1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) btn1.Visible = False btn2.Visible = True End Sub
Then change the Object from “btn1” to “btn2” and then procedure from “Click” to “MouseMove” and add the following code to btn2_MouseMove.
Private Sub btn2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) btn1.Visible = True btn2.Visible = False End Sub
Now your code should look like below image.
Remove following unnecessary codes.
Private Sub btn1_Click() End Sub
Private Sub btn2_Click() End Sub
Now you can Make the executable of the project from File > Make <ProjectName>.exe.
Run the exe and Enjoy 😀
You can download the Compiled Executable below.
All the information provided on this site are for educational purposes only. The site and authors of the website is no way responsible for any use or misuse of the information.