package
App_VJSNet; import
System.Drawing.*;
import System.Collections.*;
import System.ComponentModel.*;
import System.Windows.Forms.*;
import System.Data.*;
/**
* Summary description for Form1.
*/
public
class
MainForm extends
System.Windows.Forms.Form
{
private
System.Windows.Forms.MenuItem menuItem5;
private
System.Windows.Forms.MenuItem menuItem4;
private
System.Windows.Forms.MenuItem menuItem3;
private
System.Windows.Forms.MainMenu mainMenu1;
private
System.Windows.Forms.MenuItem menuItem1;
private
System.Windows.Forms.MenuItem menuItem2;
private
System.Windows.Forms.MenuItem menuItem6;
private
System.Windows.Forms.Timer timer1;
private
System.Windows.Forms.Label label1;
private
System.Windows.Forms.PictureBox pictureBox1;
public
System.Windows.Forms.StatusBarPanel statusBarPanel2;
public
System.Windows.Forms.StatusBarPanel statusBarPanel1;
public
System.Windows.Forms.StatusBar statusBar1;
public
System.Windows.Forms.StatusBarPanel statusBarPanel3;
private
System.ComponentModel.IContainer components;
public
MainForm()
{
//
// 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);
}
#region Windows Form Designer
generated code
/**
* Required method for Designer support - do not modify
* the contents of this method with the code editor.
*/
private
void
InitializeComponent()
{
this.components =
new
System.ComponentModel.Container();
System.Resources.ResourceManager resources =
new
System.Resources.ResourceManager(MainForm.class.ToType());
this.menuItem5 =
new
System.Windows.Forms.MenuItem();
this.menuItem4 =
new
System.Windows.Forms.MenuItem();
this.menuItem3 =
new
System.Windows.Forms.MenuItem();
this.mainMenu1 =
new
System.Windows.Forms.MainMenu();
this.menuItem1 =
new
System.Windows.Forms.MenuItem();
this.menuItem2 =
new
System.Windows.Forms.MenuItem();
this.menuItem6 =
new
System.Windows.Forms.MenuItem();
this.timer1 =
new
System.Windows.Forms.Timer(this.components);
this.label1 =
new
System.Windows.Forms.Label();
this.pictureBox1
= new
System.Windows.Forms.PictureBox();
this.statusBarPanel2
= new
System.Windows.Forms.StatusBarPanel();
this.statusBarPanel1
= new
System.Windows.Forms.StatusBarPanel();
this.statusBar1 =
new
System.Windows.Forms.StatusBar();
this.statusBarPanel3
= new
System.Windows.Forms.StatusBarPanel();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
this.SuspendLayout();
//
// menuItem5
//
this.menuItem5.set_Index(3);
this.menuItem5.set_Text("-");
//
// menuItem4
//
this.menuItem4.set_Index(2);
this.menuItem4.set_Text("About");
this.menuItem4.add_Click(
new
System.EventHandler(this.menuItem4_Click)
);
//
// menuItem3
//
this.menuItem3.set_Index(1);
this.menuItem3.set_Text("-");
//
// mainMenu1
//
this.mainMenu1.get_MenuItems().AddRange(new
System.Windows.Forms.MenuItem[]
{
this.menuItem1}
);
//
// menuItem1
//
this.menuItem1.set_Index(0);
this.menuItem1.get_MenuItems().AddRange(new
System.Windows.Forms.MenuItem[]
{
this.menuItem2,
this.menuItem3,
this.menuItem4,
this.menuItem5,
this.menuItem6}
);
this.menuItem1.set_Text("Main
Menu");
//
// menuItem2
//
this.menuItem2.set_Index(0);
this.menuItem2.set_Text("Book");
this.menuItem2.add_Click(
new
System.EventHandler(this.menuItem2_Click)
);
//
// menuItem6
//
this.menuItem6.set_Index(4);
this.menuItem6.set_Text("Exit");
this.menuItem6.add_Click(
new
System.EventHandler(this.menuItem6_Click)
);
//
// timer1
//
this.timer1.set_Enabled(true);
this.timer1.add_Tick(
new
System.EventHandler(this.timer1_Tick)
);
//
// label1
//
this.label1.set_Font(new
System.Drawing.Font("Microsoft Sans Serif", 9.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold
| System.Drawing.FontStyle.Italic))),
System.Drawing.GraphicsUnit.Point, ((ubyte)(System.Byte)(((ubyte)0)))));
this.label1.set_Location(new
System.Drawing.Point(112, 240));
this.label1.set_Name("label1");
this.label1.set_Size(new
System.Drawing.Size(376, 16));
this.label1.set_TabIndex(5);
this.label1.set_Text("Learn
how to write Microsoft Visual J# .Net application ...");
this.label1.set_TextAlign(System.Drawing.ContentAlignment.MiddleCenter);
//
// pictureBox1
//
this.pictureBox1.set_BorderStyle(System.Windows.Forms.BorderStyle.FixedSingle);
this.pictureBox1.set_Image(((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))));
this.pictureBox1.set_Location(new
System.Drawing.Point(112, 16));
this.pictureBox1.set_Name("pictureBox1");
this.pictureBox1.set_Size(new
System.Drawing.Size(375, 199));
this.pictureBox1.set_SizeMode(System.Windows.Forms.PictureBoxSizeMode.AutoSize);
this.pictureBox1.set_TabIndex(4);
this.pictureBox1.set_TabStop(false);
//
// statusBarPanel2
//
this.statusBarPanel2.set_Alignment(System.Windows.Forms.HorizontalAlignment.Center);
this.statusBarPanel2.set_ToolTipText("Date");
//
// statusBar1
//
this.statusBar1.set_Location(new
System.Drawing.Point(0, 251));
this.statusBar1.set_Name("statusBar1");
this.statusBar1.get_Panels().AddRange(new
System.Windows.Forms.StatusBarPanel[]
{
this.statusBarPanel1,
this.statusBarPanel2,
this.statusBarPanel3}
);
this.statusBar1.set_ShowPanels(true);
this.statusBar1.set_Size(new
System.Drawing.Size(680, 22));
this.statusBar1.set_TabIndex(6);
//
// statusBarPanel3
//
this.statusBarPanel3.set_Alignment(System.Windows.Forms.HorizontalAlignment.Center);
this.statusBarPanel3.set_ToolTipText("Time");
//
// MainForm
//
this.set_AutoScaleBaseSize(new
System.Drawing.Size(5, 13));
this.set_ClientSize(new
System.Drawing.Size(680, 273));
this.get_Controls().Add(this.statusBar1);
this.get_Controls().Add(this.label1);
this.get_Controls().Add(this.pictureBox1);
this.set_FormBorderStyle(System.Windows.Forms.FormBorderStyle.FixedSingle);
this.set_Icon(((System.Drawing.Icon)(resources.GetObject("$this.Icon"))));
this.set_MaximizeBox(false);
this.set_Menu(this.mainMenu1);
this.set_Name("MainForm");
this.set_Text("Main
Form");
this.set_WindowState(System.Windows.Forms.FormWindowState.Maximized);
this.add_Load(
new
System.EventHandler(this.MainForm_Load)
);
this.add_Closed(
new
System.EventHandler(this.MainForm_Closed)
);
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).EndInit();
this.ResumeLayout(false);
}
#endregion
/**
* The main entry point for the application.
*/
/** @attribute
System.STAThread() */
public
static
void main(String[]
args)
{
Application.Run(new
MainForm());
}
private
void MainForm_Load
(Object sender, System.EventArgs e)
{
// Resize ...
// PictureBox control
this.pictureBox1.set_Left((this.get_Width()
- this.pictureBox1.get_Width())
/ 2);
this.pictureBox1.set_Top(this.get_Height()
/ 4);
// Label control
this.label1.set_Width(
this.get_Width() -
100);
this.label1.set_Left((this.get_Width()
- this.label1.get_Width())
/ 2);
this.label1.set_Top(this.get_Height()
* 3 / 4);
this.statusBarPanel1.set_Width((this.get_Width()
* 3)/8);
this.statusBarPanel2.set_Width(this.get_Width()
* 3/ 8);
this.statusBarPanel3.set_Width(this.get_Width()
* 2 / 8);
// StatusBar Panel 1,
Message ...
this.statusBarPanel1.set_Text("Hello
...");
// StatusBarPanel2,
Date ...
this.statusBarPanel2.set_Text(System.DateTime.get_Now().ToLongDateString());
}
private
void menuItem2_Click
(Object sender, System.EventArgs e)
{
// StatusBar Panel 1
= Message
this.statusBarPanel1.set_Text("Book
Form, moment ...");
Book Fbook =
new
Book();
Fbook.Show();
}
private
void menuItem4_Click
(Object sender, System.EventArgs e)
{
// StatusBar Panel 1
= Message
this.statusBarPanel1.set_Text("About
Form, moment ...");
About Fabout =
new
About();
Fabout.Show();
}
private
void menuItem6_Click
(Object sender, System.EventArgs e)
{
Application.Exit();
}
private
void timer1_Tick
(Object sender, System.EventArgs e)
{
// StatusBarPanel3,
Time...
this.statusBarPanel3.set_Text(System.DateTime.get_Now().ToLongTimeString());
}
private
void MainForm_Closed
(Object sender, System.EventArgs e)
{
Application.Exit();
}
}
|