How to make a screen blocker that dis-ables it closing

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
5 posts Page 1 of 1
Contributors
User avatar
dradra43
New Member
New Member
Posts: 13
Joined: Sat Nov 06, 2010 9:56 pm

Level = ★★☆☆☆

Ok, lets begin earlier this time!

To start, make a new project, name it MOM (so that when hiot ctrl+alt+delete and go to processes, there are 2 MOM.exe files, and you wont be-able to find out which is which)

Now, dont worry about sizes, or border styles, cause in the code, on form1_load, it will auto do it, so you dont have to!
Next, add the following:
  • ● 1 group box (not text)
    ● 2 textbox's (textbox1 outside the groupbox and textbox2 inside the groupbox)
    ● 2 buttons(same, button1 outside of the groupbox and button2 inside)
Now, change Button1's text Lock, Button2's to UnLock

TextBox1+2 change the PasswordCharacter to [*]

Then add an extra button, and dont even worry about it, it will just be an emergency button, just in-case something goes wrong during testing... We will delete it after the program is forsure done.

Coding time! lmao;

Our emergency button code
Code: Select all
End
That was easy :shock:

Now, drag the groupbox(which should have button2 and textbox2 in it) over textbox1 and button1

Lock button (button1) code
Code: Select all
If TextBox1.Text = "Enter lock code here" Then
            MsgBox("You must enter a password code!!!")
        ElseIf TextBox1.Text = "" Then
            MsgBox("You must enter a password code!!!")
        Else
            GroupBox1.Visible = True
            Button1.Visible = False
            TextBox1.Visible = False
        End If
UnLock (button2) code
Code: Select all
If Textbox2.Text = Textbox1.Text Then
end
elseif textbox2.Text = "" Then
MsgBox("You didnt enter anything", MsgBoxStyle.Critical, "ERROR")
else
MsgBox("Wrong Password, please try again", MsgBoxStyle.Critical, "ERROR")
Now, under form1_load paste this
Code: Select all
GroupBox1.Visible = False
        Me.Top = 0
        Me.Left = 0
        Me.Width = "1386"
        Me.Height = "788"
        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None

Thats it! wahooo;

Now debug it! After it is sucessful, delete that emergency button.
----------------------------------------EXTRA FUN STUFF TO DO WITH PROGRAM!------------------------------------------------
Level = ★☆☆☆☆

Just to have some fun while its locked, lets make it so you can DRAW! Just like in my paint tutorial, lets begin!
Using the same program, double click form1, and do the following:
  • open:
    • ● form1_MouseClick
      ● form1_MouseMove
      ● form1_MouseDown
      ● form1_MouseUp
    create:
    • ● PictureBox1 (docked in parent cantainer & send it to back(Right click<Send To Back))

under public class form1 put this:
Code: Select all
Dim down = False
Under the Form1_MouseDown
Code: Select all
down = true
under Form1_MouseUp
Code: Select all
down = false
Under Form1_MouseClick AND Form1_MouseMove put this
Code: Select all
If down = True Then
            PictureBox1.CreateGraphics.FillEllipse(Brushes.Black, e.X, e.Y, 15, 15)
        End If
You should be done! wahooo;
Image
Image
Image
~VB CODER~
NoWayIn
VIP - Donator
VIP - Donator
Posts: 444
Joined: Sat Nov 21, 2009 11:16 pm

Nice tutorial there, keep it up.
One thing though, not all computer will have MOM.exe in their process list.
if you want to name it so they can not figure out which program it is I suggest naming it something like explorer.exe
User avatar
Kieken72
VIP - Donator
VIP - Donator
Posts: 231
Joined: Sun May 02, 2010 10:38 am

NoWayIn wrote:
Nice tutorial there, keep it up.
One thing though, not all computer will have MOM.exe in their process list.
if you want to name it so they can not figure out which program it is I suggest naming it something like explorer.exe
Haha :p Nice, You can also add a feature that blocks Alt-Ctrl-Delete
User avatar
XTechVB
VIP - Site Partner
VIP - Site Partner
Posts: 727
Joined: Thu May 20, 2010 10:32 am

Nice Tutorial dude, Keep it Up!
You can find me on Facebook or on Skype mihai_92b
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Great tutorial man, you deserve reputation!
Image
5 posts Page 1 of 1
Return to “Tutorials”