VB .NET

VB .NET

Slip16

Q.1)  Write a Vb.net program to design the following form,  it contains  the three menus  Color (Red,Blue,Green) ,Window(Maximize, Minimize, Restore) and Exit. On Selection of any menu or submenu result should affect the form control( for example if user selected Red color from Color menu back color of form should get changed to Red and if user selected Maximize from Window Menu then form should get maximized).  [Marks 20] 

Solution

Public Class slip16

   

Private Sub MaximizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MaximizeToolStripMenuItem.Click

        Me.WindowState = FormWindowState.Maximized

    End Sub

 

    Private Sub MinimizeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MinimizeToolStripMenuItem.Click

        Me.WindowState = FormWindowState.Minimized

    End Sub

 

    Private Sub CloseToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseToolStripMenuItem.Click

        Me.WindowState = FormWindowState.Normal

    End Sub

 

    Private Sub RedToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RedToolStripMenuItem.Click

        Me.BackColor = Color.Red

    End Sub

 

    Private Sub BlueToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BlueToolStripMenuItem.Click

        Me.BackColor = Color.Blue

    End Sub

 

    Private Sub GreenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GreenToolStripMenuItem.Click

        Me.BackColor = Color.Green

    End Sub

 

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click

        Me.Close()

    End Sub

 

    Private Sub slip16_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

    End Sub

End Class


BCA Pratical Solution

My name is Vivek And I from Mumbai and Complete my Graduation Bca.my Age is 23 Years.

Post a Comment

Previous Post Next Post