|
|
|
|
|
The Microsoft Visual J# .Net member of
the Microsoft Visual Studio .Net |
|
Face Game VJ Net application ..., describe how to use Microsoft
Visual J# .Net to create game application
The Classes
used in this application
System Drawing, ImageList, Label, MainMenu, Panel, PictureBox, Timer,
ToolBar
- Name -
Face Game VJ
Net
- Game
Software.
- Developed with
Microsoft Visual J# .Net.
- Functions
...
- Arrange boxes
using the mouse
- Demo
Game
|
- Requirements:
Microsoft Visual Studio .Net.
If
you want to run it:
- Remove the
read-only attribute of all files in the
folder - C:\Face Game VJ
Net
- Run the
Microsoft Visual Studio .Net.
- From
File menu, choose Open,
choose Project ..., the
Open Project dialog box appears,
select the project file Face Game VJ Net.vjsproj -
(C:\Face Game VJ
Net\Face Game VJ Net.vjsproj) and then click
Open.
- From
Debug menu, choose and click
Start.
|
Project - Face Game VJ
Net
and those
items
|
|
|
1. |
Create new Visual J# .Net project -
Face Game VJ Net.vjsproj
|
Run
Microsoft Visual Studio
.Net. On the
File menu , click New, and then click
Project .... The New Project dialog box
appears.
- In the
Project Types pane, select the Visual J#
Projects folder.
- In the
Templates pane, select Windows Application
icon (project type). A message appears indicating the
type of project you are going to create - (A project
for creating an application with a Windows user
interface).
- In the
Name box, type Face Game VJ
Net.
- In the
Location box, type
C:\
- Click
OK.
The Windows Application create all
necessary files and opens the Visual J# .Net
project - Face Game VJ
Net.
Rename the
created Form - Form1.vj
- On the
View menu , click Solution
Explorer
- In Solution
Explorer, expand the Face Game VJ
Net project node and select
Form1.jsl
- In
Properties windows, Type the new File Name =
FaceGameNet.jsl
|
Old |
New |
Filename : |
Form1.jsl |
FaceGameNet.vj |
|
| |
|
|
2. |
FaceGameNet.vj
a. |
After running, the
following designs display by
order
|
b. |
The View
design..
From the Toolbox\windows Form
add the following controls One ImageList
control, thirty eight Label controls ,
one MainMenu controls, twele
Panel controls,
tree PictureBox
controls, one ToolBar
controls and four Timer
controls.
The Functions
...
Arrange boxes using the
mouse
|
c. |
The Codes
...
Note
- random numbers order :
in C#, the random number generator used
System.Random randomc = new Random();
int crnd;
crnd = randomc.Next(400);
| | |
1. |
DemoForm.vj
This Form
displays when you select the Zoom button ( zoom+ )
from PictureForm.vj
The Form
design.
The View
design.
From the Toolbox\windows
Form add the following controls
One button
control, forty six Label controls, teen Panel
controls, one PictureBox control and two
Panel controls.
The Functions
... Show
how this Game work .
The Codes
...
|
2. |
AboutForm.vj
This Form displays, when you select
the Toolbar Button About from
FaceGameNet.vj.
This Form includes the
following controls:
Tree
PictureBox control, seven
Label controls, one Button control
and one Timer control.
Click the Button Done,
the current Form
unload
The Code ...
package
Face_Game_VJ_Net;
import
System.Drawing.*;
import
System.Collections.*;
import
System.ComponentModel.*;
import
System.Windows.Forms.*;
/**
* Summary
description for AboutForm.
*/
public
class
AboutForm extends
System.Windows.Forms.Form
{
System.Windows.Forms.PictureBox picicoOrg1;
System.Windows.Forms.PictureBox picicoOrg0;
System.Windows.Forms.PictureBox picico;
System.Windows.Forms.Button btndone;
public
System.Windows.Forms.Label Line1;
System.Windows.Forms.Timer Timer1;
System.Windows.Forms.Label Label4;
System.Windows.Forms.Label Label2;
System.Windows.Forms.Label label6;
System.Windows.Forms.Label Label5;
System.Windows.Forms.Label Label7;
System.Windows.Forms.Label Label1;
private
System.ComponentModel.IContainer components;
//Variable
int
IcoNmbr;
public
AboutForm()
{
//
//
Required for Windows Form Designer support
//
InitializeComponent();
//
//
TODO: Add any constructor code after InitializeComponent
call
//
}
/**
* Clean up any
resources being used.
*/
protected
void
Dispose(boolean
disposing)
{
if
(disposing)
{
if
(components != null)
{
components.Dispose();
}
}
super.Dispose(disposing);
}
Windows Form Designer
generated code |
private
void
AboutForm_Load (Object sender, System.EventArgs e)
{
IcoNmbr = 0;
this.Timer1.set_Enabled(true);
}
private
void
btndone_Click (Object sender, System.EventArgs e)
{
// To close the
current form
this.Close();
}
private
void
Timer1_Tick (Object sender, System.EventArgs e)
{
if
(IcoNmbr == 0)
{
this.picico.set_Image(this.picicoOrg0.get_Image());
IcoNmbr = 1;
}
else
{
this.picico.set_Image(this.picicoOrg1.get_Image());
IcoNmbr = 0;
}
}
} |
| |
|
|