Dot Net Framework
A)
Write a program in C# to create a function to swap the values of two integers.
Answer :
Output :
B)
Write a Vb.net program to design the following form; it contains the three
menus
Color
(Red, Blue, and Green), Window (Maximize, Minimize, and 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).
Answer :
Public Class Form1
Private Sub
RedToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RedToolStripMenuItem.Click
Me.BackColor = Color.Red
End Sub
Private Sub
GreenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GreenToolStripMenuItem.Click
Me.BackColor = Color.Green
End Sub
Private Sub BlueToolStripMenuItem_Click(sender
As Object, e As EventArgs) Handles BlueToolStripMenuItem.Click
Me.BackColor = Color.Blue
End Sub
Private Sub
MaximizeToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MaximizeToolStripMenuItem.Click
Me.WindowState = FormWindowState.Maximized
End Sub
Private Sub
MiniMToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles MiniMToolStripMenuItem.Click
Me.WindowState =
FormWindowState.Minimized
End Sub
Private Sub
RestoreToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles RestoreToolStripMenuItem.Click
Me.WindowState =
FormWindowState.Normal
End Sub
End Class
Output :
No comments:
Post a Comment