Public
Class
mainformInherits
System.Windows.Forms.Form
Dim fintro As New
introductory
Dim fabout As New
about
Dim response As
MsgBoxResult
Dim msg_inf As
String
Dim flg_close As
Boolean
Dim vtime As New
System.DateTime
Windows Form
Designer generated
code |
Private
Sub
mainform_Load(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles
MyBase.Load
Dim var As Integer
Me.Lrbt.Left
= Me.ToolBar1.Width
- (Me.Lrbt.Width
+ 30)
Me.Lrbt.Top
= 2
Me.ltimer.Left
= Me.Lrbt.Left
+ ((Me.Lrbt.Width
- Me.ltimer.Width)
/ 2)
Me.ltimer.Top
= Me.Lrbt.Top
+ Me.Lrbt.Height
Me.lblb.Width
= Me.Panel1.Width
/ 5
Me.lblb.Left
= 4
Me.lblb.Top
= Me.ToolBar1.Top
+ Me.ToolBar1.Height
+ 6
Me.Panel1.Left
= Me.lblb.Left
Me.Panel1.Top
= Me.lblb.Top
Me.Panel1.Height
= Me.Height
- (Me.ToolBar1.Height
* 6 / 2)
Me.Panel11.Width
= Me.Panel1.Width
Me.Btntools.Width
= Me.Panel11.Width
Me.Panel11.Height
= Me.Panel1.Height
- (Me.Btntools.Height
* 1) + 8
Me.Panel11.Left
= 0
Me.Pic_booknote.Left
= Me.Pic_calculator.Left
Me.Pic_agenda.Left
= Me.Pic_calculator.Left
Me.Pic_intro.Left
= Me.Pic_calculator.Left
Me.Pic_about.Left
= Me.Pic_about.Left
var = (Me.Panel11.Height
- (Me.Pic_calculator.Height
* 5)) / 7
Me.Pic_calculator.Top
= var
Me.Pic_booknote.Top
= Me.Pic_calculator.Top
+ Me.Pic_calculator.Height
+ var
Me.Pic_agenda.Top
= Me.Pic_booknote.Top
+ Me.Pic_booknote.Height
+ var
Me.Pic_intro.Top
= Me.Pic_agenda.Top
+ Me.Pic_agenda.Height
+ var
Me.Pic_about.Top
= Me.Pic_intro.Top
+ Me.Pic_intro.Height
+ var
Me.Lrbt.Visible
= True
Me.ltimer.Visible
= True
'Current directory/Path
current_path = "C:\work_VBNet"
flg_close =
True
End
Sub
Private
Sub
mainform_Closing(ByVal
sender As
Object,
ByVal
e As
System.ComponentModel.CancelEventArgs)
Handles
MyBase.Closing
If
flg_close = True
Then
msg_inf = "are you sure want to
exit work .net"
response = MsgBox(msg_inf,
MsgBoxStyle.DefaultButton2
Or
MsgBoxStyle.Information
Or
MsgBoxStyle.YesNo, Title)
flg_close =
False
'Gets the result of the
MessageBox display.
If
(response = MsgBoxResult.Yes)
Then
Me.Close()
End
If
If
(response = MsgBoxResult.No)
Then
e.Cancel =
True
flg_close =
True
End
If
End
If
End
Sub
Private
Sub
mainform_MouseMove(ByVal
sender As
Object,
ByVal
e As
System.Windows.Forms.MouseEventArgs)
Handles
MyBase.MouseMove
Me.Panel1.Visible
= False
End
Sub
Private
Sub
Timer1_Tick(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Timer1.Tick
' Time ...
Me.ltimer.Text
= vtime.Now.ToLongTimeString.ToString
End
Sub
Private
Sub
lblb_MouseMove(ByVal
sender As
Object,
ByVal
e As
System.Windows.Forms.MouseEventArgs)
Handles
lblb.MouseMove
Me.Panel1.Visible
= True
Sub_Top1()
End
Sub
Private
Sub
Btntools_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Btntools.Click
Sub_Top1()
End
Sub
Private
Sub
Sub_Top1()
Me.Panel11.Visible
= True
Me.Btntools.Top
= 4
End
Sub
Private
Sub
Menucal_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Menucal.Click
Dim
fcalculator As
New
calculator
fcalculator.ShowDialog()
End
Sub
Private
Sub
Menubooknote_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Menubooknote.Click
fbooknote.ShowDialog()
End
Sub
Private
Sub
Menuagenda_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Menuagenda.Click
Active_Flag =
True
fagenda.Refresh()
fagenda.ShowDialog()
End
Sub
Private
Sub
Menuintroductory_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles
Menuintroductory.Click
fintro.ShowDialog()
End
Sub
Private
Sub
Menuabout_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Menuabout.Click
fabout.ShowDialog()
End
Sub
Private
Sub
Menuquit_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Menuquit.Click
sub_close()
End
Sub
Private
Sub
sub_close()
If
flg_close = True
Then
msg_inf = "are you sure want to
exit Work .net"
response = MsgBox(msg_inf,
MsgBoxStyle.DefaultButton2
Or
MsgBoxStyle.Information
Or
MsgBoxStyle.YesNo, Title)
flg_close =
False
'Gets the result of the
MessageBox display.
If
(response = MsgBoxResult.Yes)
Then
Me.Close()
End
If
If
(response = MsgBoxResult.No)
Then
flg_close =
True
End
If
End
If
End
Sub
Private
Sub
ToolBar1_ButtonClick(ByVal
sender As
System.Object, ByVal
e As
System.Windows.Forms.ToolBarButtonClickEventArgs)
Handles
ToolBar1.ButtonClick
Select
Case
Me.ToolBar1.Buttons.IndexOf(e.Button)
Case
2
' calculator
Menucal_Click(sender, e)
Case
5
' book note
Menubooknote_Click(sender, e)
Case
8
' agenda
Menuagenda_Click(sender, e)
Case
11
' introductory
fintro.ShowDialog()
Case
14
' about work .Net
fabout.ShowDialog()
End
Select
End
Sub
Private
Sub
Pic_calculator_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Pic_calculator.Click
Me.Panel1.Visible
= False
' calculator
Menucal_Click(sender, e)
End
Sub
Private
Sub
Pic_booknote_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Pic_booknote.Click
Me.Panel1.Visible
= False
' book note
Menubooknote_Click(sender, e)
End
Sub
Private
Sub
Pic_agenda_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Pic_agenda.Click
Me.Panel1.Visible
= False
' agenda
Menuagenda_Click(sender, e)
End
Sub
Private
Sub
Pic_intro_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Pic_intro.Click
Me.Panel1.Visible
= False
' introductory
Me.Menuintroductory_Click(sender,
e)
End
Sub
Private
Sub
Pic_about_Click(ByVal
sender As
System.Object, ByVal
e As
System.EventArgs)
Handles Pic_about.Click
Me.Panel1.Visible
= False
' about work .net
Me.Menuabout_Click(sender,
e)
End
Sub
End
Class
|