Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS411 Visual Programming Assignment No 02 Spring 2019 Solution & Discussion

Views: 2670

Replies to This Discussion

Bhai is ka code ap na nhi mention kiya kindly ya b kar do 

    • Upon clicking “Submit” button, one of the following things may happen:
      • If any of field is blank it will show a dialog box.
    • VUID field is blank
    • Name field is blank
    • Write proper message.


    • Message has been saved dialog box. Dialog box title should be your “VUID”

ok bro

Bhai bna daty o portion b to assignment upload kar lata 

Someone plx send the code source as soon as possible. 

need coad files

extend date mili ha ya ni

Kindly Share code. Today is extended Day.

and tell me where is the problem in this code?

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.IO;
using System.Windows;
using System.Linq;
using System;
namespace Assignment_2
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
private string filepath = @"C:\Users\Zahidx9\Desktop\cs411.txt";
public MainWindow()

string[] data= loadDataFromFile();


private void loadDataInFromFile(string[]data)
string[] data = File.ReadAllLines(filePath);
etName.Text = data[0];
etVUID.text = data[1];
cboxDegree.Text = data[2];
string gender = data[3];
if (gender.Equals("Male"))
rdMale.IsChecked = true;
rdFemale.IscChecked = true;
etComments.Text = data[4];

private void Button_Click(object sender, RoutedEventArgs e)
string[] data = GetDataFromForm();

File.WriteAllLines(filepath, data);

private readonly string[] dataFromForm;

private string[] GetDataFromForm()
return dataFromForm;

//1st line
string name = etName.Text;
//2st line
string etVUID = etName.Text;
//3st line
string degree = cboxDegree.Text;
//4st line
string gender = "Male";
private static object etVUID;

(rdMale.IsChecked == true)
gender= "Female";
string comments = etComments.Text;
string[] data = { name, VUID, Degree, Gender, Comments };
return data;
private void window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
string[] datafromform = getdataFromForm();
string dataFromFilr = loadDataFromFile();
if (DataFromFile.SequenceFile(datafromform == false)
MessageBoxResult result = MessageBox.Shoe("Do you want to save changes?, "Assignment ");
switch (result)
case MessageBoxResult.Yes:
string[] data = getDataFromForm();
File.WriteAllLines(filepath, data);
case MessageBoxResult.No:

case MessageBoxResult.Cancel:
e.Cancel = true;


@ Zahidx9 Front end design code(xeml) bi share karo Then errors dekhe keh bta skta


using System.IO;using System.IO;using System.Windows;using System.Linq;namespace cs411_a2    {/// <summary>/// Interaction logic for MainWindow.xaml/// </summary>public partial class MainWindow : Window{private string filepath = @"C:\Users\user\Desktop\file.txt";public MainWindow(){ InitializeComponent(); loadDataFormFile();}
private void loadDataFormFile(){ string[] data= //File.ReadAllLines(filepath); etname.text = data[0]; etvuID.text = data[1]; cboxdegree.text = data[2]; string gender = data [3]; if (gender.equals("Male")) { rdmale.ischecked = true; } else { rdfemale.ischecked = true; } etcomments.text = data[4];
private void btnSubmit_Click(object sender, RoutedEventArgs e){
string[] data = getdataformform(); file.writeallLines(filepath, data);}private string[] getdataformform(){ // 1st line string name =etname.text; //2nd line string vuID =etvuID.text; //3rd line string degree = cboxdegree.text; //4th line string gender = "Male"; if(rdfemale.ischecked == true) { gender= "Female"; } //5th lines string comments = etcomments.text; string[] data = {name, vuID, degree, gender, comments }; return data; private void window_closing(object sender system.componentmodel.canceleventargs e) {   var result ="do you want to save changes ?") } }}  

koi visual studio par run kr day yeh code

xaml code

Window x:Class="Assignment_2.MainWindow"
Title="MainWindow" Height="500" Width="800">
<Label Content="Name:" HorizontalAlignment="Left" Height="28" Margin="332,29,0,0" VerticalAlignment="Top" Width="174" FontSize="14" FontFamily="Arial"/>
<Label Content="VUID:" HorizontalAlignment="Left" Height="28" Margin="332,75,0,0" VerticalAlignment="Top" Width="174" FontSize="14" FontFamily="Arial"/>
<Label Content="Degree Program:" HorizontalAlignment="Left" Height="28" Margin="332,123,0,0" VerticalAlignment="Top" Width="174" FontSize="14" FontFamily="Arial"/>
<Label Content="Gender:" HorizontalAlignment="Left" Height="28" Margin="332,171,0,0" VerticalAlignment="Top" Width="174" FontSize="14" FontFamily="Arial"/>
<Label Content="Comments:" HorizontalAlignment="Left" Height="28" Margin="332,223,0,0" VerticalAlignment="Top" Width="174" FontSize="14" FontFamily="Arial"/>
<TextBox x:Name="name" HorizontalAlignment="Left" Height="28" Margin="534,29,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="194" TextChanged="TextBox_TextChanged" FontSize="14" FontFamily="Arial"/>
<TextBox x:Name="VUID" HorizontalAlignment="Left" Height="28" Margin="534,75,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="194" FontSize="14" FontFamily="Arial"/>
<RadioButton x:Name="Male" Content="Male" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="534,177,0,0" Checked="RadioButton_Checked" FontSize="14" FontFamily="Arial"/>
<RadioButton x:Name="Female" Content="Female" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="643,177,0,0" FontFamily="Arial" FontSize="14"/>
<ComboBox x:Name="degree" RenderTransformOrigin="2.458,-2.957" Margin="534,123,64,318" FontFamily="Arial" FontSize="14" SelectionChanged="ComboBox1_SelectionChanged">
<ComboBoxItem Content="BS Computer Science"/>
<ComboBoxItem Content="BS Physics"/>
<ComboBoxItem Content="BS Information Technology"/>
<TextBox x:Name="comments" HorizontalAlignment="Left" Height="125" Margin="534,223,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="194" FontFamily="Times New Roman"/>
<Button x:Name="button" Content="Submit" HorizontalAlignment="Left" Height="30" Margin="534,365,0,0" VerticalAlignment="Top" Width="194" Click="Button_Click" FontSize="14" FontFamily="Arial"/>
<Image Margin="69,101,526,158" Source="Untitled.png" Stretch="Fill"/>


Looking For Something? Search Below

Latest Activity

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

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