Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

First I want the folder to be names CIS233 N Lab 6 I want the Form Name as Object Factory with an icon image You will be creating a program that receives input from users and creates requested objects...

1 answer below »
First I want the folder to be names CIS233 N Lab 6
I want the Form Name as Object Factory with an icon image
You will be creating a program that receives input from users and creates requested objects in a different form. This will be an interactive program. The user will be choosing from a list of objects that you have provided (textbox, Button, Radio Button, and Checkbox. Your Program will be creating the objects dynamically on a second form. The user also will give you the back color, location, and size of the objects. For example, the user chooses Textbox, with the blue back color, with the size of 13 X 10, on row 10 column 12. The video is showing only one control at the time. Everything must be created dynamically. Please make the controls functional. If there is a checkbox, then it needs to do something!
Please see below for a description video and a layout picture
|
|
|
|
|
|
|
The layout should look like this:
Please watch this video for instructions: https:
www.youtube.com/watch?v=1L-11ypdqzA&feature=emb_title
Answered 1 days After Feb 13, 2021

Solution

Aditya answered on Feb 15 2021
147 Votes
CIS233NLab6/.vs/CIS233NLab6/v16/.suo
CIS233NLab6/App.config




CIS233NLab6
in/Debug/CIS233NLab6.exe
CIS233NLab6
in/Debug/CIS233NLab6.exe.config




CIS233NLab6
in/Debug/CIS233NLab6.pd
CIS233NLab6/CIS233NLab6.csproj



Debug
AnyCPU
{5EFE8F8C-0BE4-4A9D-8ED9-90C853D669E0}
WinExe
CIS233NLab6
CIS233NLab6
v4.7.2
512
true
true


AnyCPU
true
full
false
bin\Debug\
DEBUG;TRACE
prompt
4


AnyCPU
pdbonly
true
bin\Release\
TRACE
prompt
4
















Form


Form1.cs




Form1.cs


ResXFileCodeGenerato
Resources.Designer.cs
Designe


True
Resources.resx


SettingsSingleFileGenerato
Settings.Designer.cs


True
Settings.settings
True






CIS233NLab6/CIS233NLab6.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CIS233NLab6", "CIS233NLab6.csproj", "{5EFE8F8C-0BE4-4A9D-8ED9-90C853D669E0}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {5EFE8F8C-0BE4-4A9D-8ED9-90C853D669E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {5EFE8F8C-0BE4-4A9D-8ED9-90C853D669E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {5EFE8F8C-0BE4-4A9D-8ED9-90C853D669E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {5EFE8F8C-0BE4-4A9D-8ED9-90C853D669E0}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {1E81F3E5-EF39-4201-B863-9A6F20EFB8FF}
    EndGlobalSection
EndGlobal
CIS233NLab6/Form1.cs
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 CIS233NLab6
{
public partial class Form1 : Form
{
private Color color;
public Form1()
{
InitializeComponent();
}
private void selectColorButton_Click(object sender, EventArgs e)
{
ColorDialog dlg = new ColorDialog();
to create a dialog box
dlg.ShowDialog();
color = dlg.Color;
colorGroupBox.BackColor = color;
}
private void clea
utton_Click(object sender, EventArgs e)
{

resetting all the value to their default values
radioButton.Checked = false;
textBox.Checked = false;
checkBox.Checked = false;
button.Checked = false;
xtextBox.ResetText();
yTextBox.ResetText();
wTextBox.ResetText();
hTextBox.ResetText();
nameTextBox.ResetText();
textTextBox.ResetText();
colorGroupBox.BackColor = DefaultBackColor;
}
private void exitButton_Click(object sender, EventArgs e)
{
MessageBox.Show("Thank you for using the program!!");
displaying a pop up message
Close();
}
private Boolean isNumeric(string inputValue)
this function is used to check if string can be converted to int or not
{
int num;
bool check = Int32.TryParse(inputValue, out num);
return check;
}
private void Form1_Load(object sender, EventArgs e)
{
color = default;
}
private void createObjectButton_Click(object sender, EventArgs e)
create object button is clicked
{
if (isObjectSelected())
{
if (isLocationFilled())
{
if (isSizeFilled())
{
if (nameTextBox.TextLength != 0)
{
if (textTextBox.TextLength != 0)
{
int x = Int32.Parse(xtextBox.Text);
int y = Int32.Parse(yTextBox.Text);
int w = Int32.Parse(wTextBox.Text);
int h = Int32.Parse(hTextBox.Text);
string name = nameTextBox.Text;
string text = textTextBox.Text;
if (radioButton.Checked == true)
{
RadioButton r = new RadioButton();
r.Location = new Point(x, y);
r.BackColor = color;
r.Height = h;
r.Width = w;
r.Name = name;
r.Text = text;
Form F = new Form();
F.Controls.Add(r);
F.Show();
}
else if (textBox.Checked == true)
{
TextBox t = new TextBox();
t.Location = new Point(x, y);
t.BackColor = color;
t.Height = h;
t.Width = w;
t.Name = name;
t.Text = text;
Form F = new Form();
F.Controls.Add(t);
F.Show();
}
else if (checkBox.Checked == true)
{
CheckBox c = new CheckBox();
c.Location = new Point(x, y);
c.BackColor = color;
c.Height = h;
c.Width = w;
c.Name = name;
c.Text = text;
Form F = new Form();
F.Controls.Add(c);
F.Show();
}
else if (button.Checked == true)
{
Button b = new Button();
b.Location = new Point(x, y);
b.BackColor = color;
b.Height = h;
b.Width = w;
b.Name = name;
b.Text = text;
b.Click += button_Click;
Form F = new Form();
F.Controls.Add(b);
F.Show();
}
}
else
{
MessageBox.Show("Text of object is missing");
}
}
else
{
MessageBox.Show("Name of object is missing");
}

}
else
{
MessageBox.Show("Size needs numeric values");
}

}
else
{
MessageBox.Show("Locations needs numeric values");
}

}
else
{
MessageBox.Show("Must select a control.");
}

}
void button_Click(object sender, EventArgs e)
{
MessageBox.Show("You Clicked me!");
}
private Boolean isObjectSelected()
check if any of radio button is selected
{
if (radioButton.Checked == true)
{
return true;
}
else if (textBox.Checked == true)
{
return true;
}
else if (checkBox.Checked == true)
{
return true;
}
else if (button.Checked == true)
{
return true;
}
return false;
}
private Boolean isLocationFilled()
this function checked location filled with int values
{
if (xtextBox.TextLength == 0 || yTextBox.TextLength == 0)
{
return false;
}
if (!isNumeric(xtextBox.Text) || !isNumeric(yTextBox.Text))
{
return false;
}
return true;
}
private Boolean isSizeFilled()
this function checks if size is filled
{
if (hTextBox.TextLength == 0 || wTextBox.TextLength == 0)
{
return false;
}
if (!isNumeric(hTextBox.Text) || !isNumeric(wTextBox.Text))
{
return false;
}
return true;
}
}
}
CIS233NLab6/Form1.Designer.cs
namespace CIS233NLab6
{
partial class Form1
{


Required designer variable.


summary
private System.ComponentModel.IContainer components = null;


Clean up any resources being used.


summary

true if managed resources should be disposed; otherwise, false.
param
protected ove
ide void Dispose(bool disposing)
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here