C#
C#
C#
SUBMITTED BY:
RAJESH RANA
ROLL NO. 16
REG. NO. 7010070005
BCA (H) – MCA
list box.
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace List_Box_Copy
public Form1()
{
InitializeComponent();
listBox1.Items.Add("Rajesh");
listBox1.Items.Add("Rana");
listBox1.Items.Add("D37d2");
listBox1.Items.Add("LPU");
listBox1.Items.Add("LSTEA");
listBox2.Items.Add(s1);
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Namespaces
namespace student
class check
public check()
}
}
namespace school
class check
public check()
class Program
Console.ReadLine();
}
}
Output :-
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
public Form1()
InitializeComponent();
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
string s = folderBrowserDialog1.SelectedPath;
listBox1.Items.Add(folderBrowserDialog1.RootFolder);
listBox2.Items.Add(folderBrowserDialog1.SelectedPath);
}
Output :-
PART B
textbox control.
Ans.
1. The Name property can be 1. Gets or sets the text content of the
used at run time to evaluate TextBox control.
name
changed :- :-
5. Using rich Text box, create an editor and Open an existing
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Open_and_save_a_file
public Form1()
{
InitializeComponent();
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
richTextBox1.Text =
File.ReadAllText(openFileDialog1.FileName);
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
Response.ContentType = "abc.txt";
Response.AppendHeader("Content-Disposition", "attachment;
filename=abc.txt");
Response.TransmitFile(Server.MapPath("~/abc/"));
Output :-
6. Using rich Text box, create an editor and perform font and
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
public Form1()
InitializeComponent();
colorDialog1.ShowDialog();
richTextBox1.BackColor = colorDialog1.Color;
colorDialog1.ShowDialog();
richTextBox1.ForeColor = colorDialog1.Color;
f1.ShowDialog();
richTextBox1.Font = f1.Font;
Output :-
To Change Back Color :-