vb.net realization of the game "you are XX"

Source: Internet
Author: User

0.

This procedure can be used in here download to.

First, about the game play

1) just entered the program, there will be a prompt form, click the "Start Test" button to formally enter the game

2) after formally entering the game form, when the mouse moves to the button "not", the button "not" on the word will become "yes", and the original button "Yes" above will show "no". Clicking on any one of the two buttons will be "humiliated" by the program, and the program will automatically exit.

3) do not attempt to close this window by opening the X in the upper right corner or by using Task Manager (TASKMGR), if you really want to close the program and do not want to admit that you are XX, use the command line.

4) You can use this program to do some mischief, or the sentence: Just for fun:-P

Second, the program control and code

1) Form FormMain

Form properties:

StartPosition (initial position)
Centerscreen
MaximizeBox (Maximize button)
False
MinimizeBox (Minimize button) False
FormBorderStyle (Form style)
FixedSingle

Form code

Public Class formmain Private Sub btntest_click (sender as Object, E as EventArgs) _ Handles Btntest.click Me.hide () Formtest.showdialog () End subend Class

2) Form Formtest

Form properties:

StartPosition (initial position) Centerscreen
MaximizeBox (Maximize button) False
MinimizeBox (Minimize button) False
FormBorderStyle (Form style) Fixed3D
Showicon (Display icon)
False
ShowInTaskbar (appears on taskbar)
False

Form code:

public class formtest     ' yes ' or ' not ' after the Boolean value becomes true, the window can be closed      The panel above dim ischoosen as boolean = false     ' uses an asymptotic color treatment      private sub pnltop_paint (Sender as object, e as painteventargs)  _        Handles pnlTop.Paint         Using LG As Drawing2D.LinearGradientBrush =            new drawing2d.lineargradientbrush (                new point (0, 0),                new point (0, Me.Height),                color.fromargb (192,  192, 255),                 color.white)              e.graphics.fillrectangle (LG, New  Rectangle (0, 0, me.width, me.height))         End  Using    end sub    private sub formtest_load (Sender  as object, e as eventargs)  _         handles mybase.load         ' mouse moves to the right button, the text on the button changes          AddHandler btnRight.MouseEnter,             sub (Obj as system.object, arg as system.eventargs)                 btnright.text  =  "Yes"                 btnleft.text =  "No"             End Sub          ' mouse moves out the right button, the text on the button is back to the same         AddHandler  Btnright.mouseleave,            sub (obj As  system.object, arg as system.eventargs)                  btnRight.Text =  "not"                  btnLeft.Text =  "Yes"              End Sub          ' mouse Press button, if the text on the button is "yes" then pop messagebox        addhandler  Btnleft.mouseclick,  &nBsp;         sub (Obj as system.object, arg as  system.eventargs)                  dim btntemp as button = directcast (Obj, button)                  if btntemp.text =   "Yes"  Then                     messagebox.show ("I knew you would choose Yes")                      isChoosen = True                      Application.exit ()                  end if            end sub          ' mouse Press button, if the text on the button is "yes" then pop messagebox        addhandler  Btnright.mouseclick,            sub (obj As  system.object, arg as system.eventargs)                  dim btntemp as button = directcast ( Obj, button)                  If btnTemp.Text =  "Yes"  Then                     messagebox.show ("I knew you would choose Yes")                       Ischoosen = true                     application.exit ()                  end if            end sub          ' Timer: Prohibit open Task Manager          DIM TMR AS NEW TIMER        ADDHANDLER TMR. Tick,            sub (obj As  System.object, arg as system.eventargs)                  dim parray as process ()  =  process.getprocesses                 For Each p As Process in parray                     Try                         if p.processname.tolower.trim =   "Taskmgr"  Then                             p.kill ()                               messagebox.show ("Boy, don't you think you're funny?" ")                               ' Put this window at the top                              Me.TopMost = True                              Me.TopMost = False                              Return                         End If                     catch ex  As Exception                         Return                     end try                 Next             END SUB        TMR. INTERVAL = 200        TMR. ENABLED = TRUE        TMR. Start ()     End Sub     ' Close window event     private  sub formtest_formclosing (Sender as object, e as formclosingeventargs)  _        Handles MyBase.FormClosing          ' If you do not select the Disable window         if ischoosen =  false then            messagebox.show (" Turn it off and I can't change the truth, you choose one.Bar ")             e.Cancel = True             Return         end if        me.hide ()          threading.thread.sleep (        messagebox.show) (              "This game is just  for fun! thx 4 playing. "  & vbCrLf & _              "           -tsybius 2014 year August 1  13:37:35 ")     end subend class

END

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.