We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

CS411 Assignment No, 3 Discussion and Solution. Due date is 30 July Spring 2018

You are required to create a WPF C# application using Visual Studio.

Problem Statement:


Create a grid Layout with one Column and two rows

  • Inside first row create another grid with two columns and two rows and then add 4 buttons. Start First ,Stop First, Start Second and Stop Second. Make the border of this layout Green.
  • Inside second row create a DockPanel and add 4 vertical[1] progress bars. Border must be red.


Pressing Start first Button will increment first two progress bars so that second progress bar is incremented faster and upon reaching 100 the first progress bar is incremented by 1.

So the second progress bar will be completed 100 times and first one only 1 time[2]. But the UI should remain responsive[3] in between this process.

Stop button will stop the process and enable the start button to start process again.

Start Second will do the same to third and fourth progress bars but both the process should work in parallel.

Output.gif has been attached with this Assignment file please observe this file carefully your program’s output must be like this output file.

Submission details

Following Files Must be submitted in a single zip or rar file.

·         .C# code file

·         .XAML File (Front End file)

·         A .gif file which shows working of your Application(For Recording .gif a software named Screentogif is uploaded on LMS, or you can use any other gif recording tool as well)

You are not required to submit the complete project, only copy these three files from project folder. Please note if you submit doc file you will be awarded 0 marks.

If you do not submit any of the above mentioned file 25% marks per file will be deducted.

[1] To Make Progress vertical you can use Layout Transform.

[2] You can use nested loops to achieve this.

[3] UI remains responsive when task is being done asynchronously in separate threads.

Views: 8306


Replies to This Discussion

bhai koi vedio link ha jis sa pata chal jay pleas share

will you send send files also or video for our good understanding

this is right way.....start understanding 

Have any body Please send the complete solution of CS411-Assignment no.3

need complete solution......

lgra es group m koi b C# ka champion n hai 

sahi kaha app na...

apki soch hai 

ashi soch rakhni chahiya 

aap ne compettion krna hai tu kr lein Visual programing ka  C# F# Asp.net ,WPF etc 

yi code theek hay iss main addition krni jo samajh nahi arahi>>>>

using System;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;using System.Threading;

namespace WpfApp2{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window {
Thread t = null; Thread t1 = null;
Boolean isEnd = false;
public MainWindow() { InitializeComponent(); }
private void Work() { for (int i = 2; i <= 100; i++) {
Thread.Sleep(100); UpdateProgressBar(i);
} isEnd = false; UpdateProgressBar(100); } private void UpdateProgressBar(int i) { Action action = () => { SetProgress(i); }; ProgressBar1.Dispatcher.BeginInvoke(action); ProgressBar2.Dispatcher.BeginInvoke(action); ProgressBar3.Dispatcher.BeginInvoke(action); ProgressBar4.Dispatcher.BeginInvoke(action); }
private void SetProgress(int i) { ProgressBar1.Maximum = 10; ProgressBar3.Maximum = 10; ProgressBar1.Value = i; ProgressBar2.Value = i; ProgressBar3.Value = i; ProgressBar4.Value = i; }
private void Button1_Click(object sender, RoutedEventArgs e) { isEnd = true; t = new Thread(Work); t.Start();
} private void Window_Closing(Object sender, System.ComponentModel.CancelEventArgs e) { try { if (t.IsAlive) t.Abort(); if (t1.IsAlive) t1.Abort(); } catch (Exception) {
} }

private void Button2_Click(object sender, RoutedEventArgs e) {
t.Abort(); ProgressBar1.Value = 0;
private void Button3_Click(object sender, RoutedEventArgs e) { isEnd = true;
t1 = new Thread(Work); t1.Start();
private void Button4_Click(object sender, RoutedEventArgs e) { t1.Abort();
ProgressBar3.Value = 0; } }}


© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service