//1. Write a program for threading demonstration in Windows [Link].
using using using using System; [Link]; [Link]; [Link];
namespace Threading { class MyThread { public int count; public Thread t; public MyThread(string name) { count = 0; t = new Thread([Link]); [Link] = name; [Link](); } void run() { [Link]([Link] + "starting"); do { [Link](500); [Link]("In " + [Link] + " Count is " + count); count++; } while (count < 5); [Link]([Link] + " terminated"); } } class ThreadDemo { public static void Main() { [Link]("Main Thread Started"); MyThread t1 = new MyThread("Child Thread #1"); MyThread t2 = new MyThread("Child Thread #2"); MyThread t3 = new MyThread("Child Thread #3"); [Link](); [Link]("Child #1 joined."); [Link](); [Link]("Child #2 joined."); [Link](); [Link]("Child #3 joined."); [Link]("Main Thread Ended"); [Link](); } } }
Output:
//2. Write for the Image Viewer in Windows [Link].
using using using using using using using System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace ImageViewer { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if ([Link] < [Link] - 1) [Link] += 1; else [Link] = 0; } private void button2_Click(object sender, EventArgs e) { if ([Link] > 0) [Link] -= 1; else [Link] = [Link] - 1; } } }
Output:
Next Image
Previous Image
//3. Design a file viewer (Similar to explorer) for Windows [Link] and 4. Give the demonstration for the various Dialog Box avail with C# Smart Device Application.
using using using using using using using System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace DialogBox { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //Change The Font private void button1_Click(object sender, EventArgs e) { [Link](); [Link] = [Link]; } //Save The File private void button4_Click(object sender, EventArgs e) { [Link](); } //Open File private void button2_Click(object sender, EventArgs e) { [Link](); } //Browse Folder private void button5_Click(object sender, EventArgs e) { [Link](); } //Change Color private void button3_Click(object sender, EventArgs e) { [Link](); [Link] = [Link]; }
//Page setup private void button6_Click(object sender, EventArgs e) { [Link](); } //Print Preview private void button7_Click(object sender, EventArgs e) { [Link](); } //Print Document private void button8_Click(object sender, EventArgs e) { [Link](); }
} } Output :
Fig. 1: Normal Screen
Fi g.2: Screen With Font Dialog
Fig. 3: Screen After Font Change With Coloe Dialog
Fig. 4: Screen with Save Dialog
Fig. 5: Screen After Color Change with Open Dialog
Fig. 6: Screen with Folder Browse
Fig. 7: Screen With Print Preview Dialog
Fig. 8: Screen with Print Dialog
//5. Write a program in C#.net for the smart device application for Mouse event handling.
using using using using using using using System; [Link]; [Link]; [Link]; [Link]; [Link]; [Link];
namespace MouseEvent { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //Mouse Enter private void Form1_MouseEnter(object sender, EventArgs e) { [Link] = "Mouse Entered the Client Area."; } //Mouse Hover private void Form1_MouseHover(object sender, EventArgs e) { [Link] = "Mouse is Hovering"; } //Mouse Down private void Form1_MouseDown(object sender, MouseEventArgs e) { if ([Link] == [Link]) [Link] = "The Left Mouse Button is Down at " + [Link]() + ", " + [Link](); } //Mouse Move private void Form1_MouseMove(object sender, MouseEventArgs e) { [Link] = "The Left Mouse Moved to: " + [Link]() + ", " + [Link](); } //Mouse Leave private void Form1_MouseLeave(object sender, EventArgs e) { [Link] = "Mouse left the Client Area."; } //Mouse Click
private void button1_Click(object sender, EventArgs e) { [Link] = "Mouse Clicked On Button."; } //Mouse Double Click private void label1_DoubleClick(object sender, EventArgs e) { [Link] = "Mouse Double Clicked On Client Area."; } } Output: }
Mouse Enter
Mouse Hover
MOUSE DOWN
MOUSE MOVE
MOUSE LEAVE
MOUSE CLICK
MOUSE DOUBLECLICK
/* 6 Design Application like notepad in Windows OutPut:
[Link].*/