Ap Lab 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

NAME

M.ZULQARNAIN
REG#
UW-20-CS-BS-063
SEMESTER
5TH-B
COURSE
ADVANCE PROGRAMMING
TASK-01
CODE

private void copyToolStripMenuItem_Click(object sender, EventArgs e)


{
if (textBox1.SelectedText == "")
{
MessageBox.Show("select something");
}
else
textBox1.Copy();

private void cutToolStripMenuItem_Click(object sender, EventArgs e)


{
if (textBox1.SelectedText == "")
{
MessageBox.Show("select something");
}
else
textBox1.Cut();

private void undoToolStripMenuItem_Click(object sender, EventArgs e)


{
if(textBox1.CanUndo==true)
{
textBox1.Undo();
textBox1.ClearUndo();
}
}

private void pasteToolStripMenuItem_Click(object sender, EventArgs e)

{
if (textBox1.ContainsFocus == true)
{
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) == true)
{
textBox3.Paste();
Clipboard.Clear();
}
}

if (textBox2.ContainsFocus == true)
{
if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text) == true)
{
textBox2.Paste();
Clipboard.Clear();
}
}

TASK-02

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void radioButton1_CheckedChanged(object sender, EventArgs e)


{
if (radioButton1.Checked)
{
BackColor = Color.Red;
}
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)


{
if (radioButton2.Checked)
{
BackColor = Color.Green;
}
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)


{
if (radioButton3.Checked)
{
BackColor = Color.Blue;
}
}

private void radioButton4_CheckedChanged(object sender, EventArgs e)


{
if (radioButton4.Checked)
{
BackColor = Color.Purple;
}
}

private void radioButton5_CheckedChanged(object sender, EventArgs e)


{
radioButton5.Font = new Font(radioButton5.Font.FontFamily, 12);
}

private void radioButton6_CheckedChanged(object sender, EventArgs e)


{
radioButton6.Font = new Font(radioButton6.Font.FontFamily, 30);
}

private void groupBox2_Enter(object sender, EventArgs e)


{
radioButton7.Font = new Font(radioButton7.Font.FontFamily, 30);
}

private void radioButton8_CheckedChanged(object sender, EventArgs e)


{
radioButton8.Font = new Font(radioButton8.Font.FontFamily, 40);
}
}
}
OUTPUT

You might also like