Public Class tsLookFrom Private m_scene As Scene 'Create buttons Dim btnTop As New ToolStripButton Dim btnIso As New ToolStripButton Dim btnFront As New ToolStripButton Dim btnBack As New ToolStripButton Dim btnLeft As New ToolStripButton Dim btnRight As New ToolStripButton Sub New() MyBase.New() Me.Anchor = AnchorStyles.None Me.Dock = DockStyle.None ' Chiamata richiesta dalla finestra di progettazione. InitializeComponent() AddButtons() ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent(). End Sub Public Sub SetScene(ByRef scene As Scene) m_scene = scene End Sub Public Sub AddButtons() With btnTop 'Set properties .Name = "btnTop" .AutoToolTip = True .DisplayStyle = ToolStripItemDisplayStyle.Image .Image = EgtUILib.My.Resources.Resources.LookFromTOP .Text = "" .ToolTipText = "Top" End With With btnIso 'Set properties .Name = "btnIso" .AutoToolTip = True .DisplayStyle = ToolStripItemDisplayStyle.Image .Image = EgtUILib.My.Resources.Resources.LookFromISO .Text = "" .ToolTipText = "Iso" End With With btnFront 'Set properties .Name = "btnFront" .AutoToolTip = True .DisplayStyle = ToolStripItemDisplayStyle.Image .Image = EgtUILib.My.Resources.Resources.LookFromFRONT .Text = "" .ToolTipText = "Front" End With With btnBack 'Set properties .Name = "btnBack" .AutoToolTip = True .DisplayStyle = ToolStripItemDisplayStyle.Image .Image = EgtUILib.My.Resources.Resources.LookFromBACK .Text = "" .ToolTipText = "Back" End With With btnLeft 'Set properties .Name = "btnLeft" .AutoToolTip = True .DisplayStyle = ToolStripItemDisplayStyle.Image .Image = EgtUILib.My.Resources.Resources.LookFromLEFT .Text = "" .ToolTipText = "Left" End With With btnRight 'Set properties .Name = "btnRight" .AutoToolTip = True .DisplayStyle = ToolStripItemDisplayStyle.Image .Image = EgtUILib.My.Resources.Resources.LookFromRIGHT .Text = "" .ToolTipText = "Right" End With 'Create a Handle to a Click Event AddHandler btnTop.Click, AddressOf btnTop_Click AddHandler btnIso.Click, AddressOf btnIso_Click AddHandler btnFront.Click, AddressOf btnFront_Click AddHandler btnBack.Click, AddressOf btnBack_Click AddHandler btnLeft.Click, AddressOf btnLeft_Click AddHandler btnRight.Click, AddressOf btnRight_Click 'Add to toolstrip MyClass.Items.Add(btnTop) MyClass.Items.Add(btnIso) MyClass.Items.Add(btnFront) MyClass.Items.Add(btnBack) MyClass.Items.Add(btnLeft) MyClass.Items.Add(btnRight) End Sub 'The Click Events Private Sub btnTop_Click(sender As Object, e As System.EventArgs) m_scene.TopView() End Sub Private Sub btnIso_Click(sender As Object, e As System.EventArgs) m_scene.IsoViewSW() End Sub Private Sub btnFront_Click(sender As Object, e As System.EventArgs) m_scene.FrontView() End Sub Private Sub btnBack_Click(sender As Object, e As System.EventArgs) m_scene.BackView() End Sub Private Sub btnLeft_Click(sender As Object, e As System.EventArgs) m_scene.LeftView() End Sub Private Sub btnRight_Click(sender As Object, e As System.EventArgs) m_scene.RightView() End Sub End Class