Open kulpot opened 8 months ago
########################## Form2.cs #######################################
using C__avatar_maker_app_12; 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 C__avatar_maker_app_13 { public partial class Form2 : Form { public Form2() { InitializeComponent(); //-----START------- C# avatar maker app 13 use a static class to store a list of objects ------------------------------- BindingSource bs = new BindingSource(); bs.DataSource = HeroList.hallOfFame; listBox1.DataSource = bs; listBox1.DisplayMember = "Name"; //ErrorSolutionFrom:Hero class needs a ToString() method or ListBox1 needs a DisplayMember property set. //-----END------- C# avatar maker app 13 use a static class to store a list of objects -------------------------------
}
}
}
############################# Hero.cs ##########################################
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace C__heromaker_10
{
public class Hero
{
//------START------ C# heromaker 10 hero object ---------------------------------------------------------
// HeroConstructorMethod //Create->Highlight all Hero Properties->CTRL+. ->Select Create Constructor Method
public Hero(string name,
bool[] specialAbilities,
List
// HeroProperties
public string Name { get; set; }
public bool[] SpecialAbilities { get; set; }
public List<String> OfficeLocations { get; set; }
public string PreferredTransport { get; set; }
public int Speed { get; set; } // This also could have benn stored as an array of int "int[] speedStamingStrength = {0,0,0};
public int Staming { get; set; }
public int Strength { get; set; }
public DateTime Birthday { get; set; }
public DateTime SuperPowerDiscoveryDate { get; set; }
public DateTime FatefulDay { get; set; }
public decimal YearsExperience { get; set; }
public String CapeColor { get; set; }
//public string CapeColor { get; set; }
public int DarkSidePropensity { get; set; }
public String PortraitPhoto { get; set; }
//public string PortraitPhoto { get; set; }
//-----END------- C# heromaker 10 hero object ---------------------------------------------------------
}
}
############################# HeroList.cs ##############################################
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using C__heromaker_10;
namespace C__avatar_maker_app_12 { //-----START------- C# avatar maker app 12 static list to work as a global variable ---------------------------- //public class HeroList //------END------ C# avatar maker app 12 static list to work as a global variable ----------------------------
//------START------ C# avatar maker app 13 use a static class to store a list of objects -------------------------------
static class HeroList // Static means that there will be exactly one copy of the list in the entire application.
//------END------ C# avatar maker app 13 use a static class to store a list of objects -------------------------------
{
//-----START------- C# avatar maker app 12 static list to work as a global variable ----------------------------
//public List<Hero> hallOfFame = new List<Hero>();
//------END------ C# avatar maker app 12 static list to work as a global variable ----------------------------
//------START------ C# avatar maker app 13 use a static class to store a list of objects -------------------------------
static public List<Hero> hallOfFame = new List<Hero>();
//------END------ C# avatar maker app 13 use a static class to store a list of objects -------------------------------
}
}
################### Form1.cs #####################################
using Cavatar_maker_app_13; using C__avatar_maker_app_12; using Cheromaker_10; 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;
//------------------ C# avatar maker app 01 How to use checkboxes tutorial ----------------------------- //ref link:https://www.youtube.com/watch?v=UgbzxnlckxY&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=15
// label(Hero's Name), textbox(MessageBox), groupbox, checkbox x8(abilities[0-7], button(btn_create), status_message
//----------------- C# avatar maker app 02 How to use a listbox tutorial ------------------------------- //ref link:https://www.youtube.com/watch?v=ihBNF1j5qNU&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=14
// listbox(Item Collection)(SelectionMode:MultiSimple), label(Office Locations)
//----------------- C# avatar maker app 03 How to use radio buttons tutorial ------------------------------ //ref link:https://www.youtube.com/watch?v=0Byuvm4acFM&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=14
// Radio button x4, groupbox(Preferred Transport), radio button x4(rdo prefix)(JetPack:Property->Checked->True,
//----------------- C# heromaker app 04 How to use scrollbars in Winforms ----------------------------------- //ref link:https://www.youtube.com/watch?v=dKXTx0swVUU&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=13
// Scroolbars(LimitSpedd+Stamina+Strength to a maximum of 100totalPts, GroupBox(Speed-Stamina-Strength), HScrollBar x3(width300height15),label x6(Speed/Stamina/Strength/lbl_speed/stamina/strenght), trackBar,
//---------------- C# hermaker app 05 How to program a date picker in C# ------------------------------------- //ref link:https://www.youtube.com/watch?v=mq0lEliFY0E&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=11
// GroupBox, DateTimePicker x3, Label x3,
//--------------- C# avatar maker app 06 How to use a number picker ------------------------------------------------ //ref link:https://www.youtube.com/watch?v=3tZNK3WPOW4&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=12
// label, numericalUpDown(name:num_year_experience), \n
//-------------- C# avatar maker app 07 How to use the color picker ---------------------------------------------- //ref link:https://www.youtube.com/watch?v=_XBet_gEycg&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=11
// label(Cape Color), pictureBox,
//------------- C# avatar maker app 08 How to use the trackbar control ------------------------------------------- //ref link:https://www.youtube.com/watch?v=H5cPurr1EeE&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=10
// label(Dark Side Propensity),label(0/lbl_dark_side), trackBar(minimum:-10/largeChange:3),
//------------- C# heromaker part 09 Picturebox control Visual Studio ------------------------------- //ref link:https://www.youtube.com/watch?v=inK--sPEgws&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=7
// groupBox(portrait), pictureBox(sizeMode:Zoom),
//-------------- C# heromaker 10 hero object --------------------------------------------------------- //ref link:https://www.youtube.com/watch?v=8zXxow4OZiY&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=6
// created Hero.cs(HeroProperties/HeroConstructorMethod),
//-------------- C# avatar maker app 12 static list to work as a global variable ---------------------------- //ref link:https://www.youtube.com/watch?v=zJKHf7gi4iM&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=4&t=20s
// created HeroList.cs,
//-------------- C# avatar maker app 13 use a static class to store a list of objects ------------------------------- //ref link:https://www.youtube.com/watch?v=LmZE2R2lUD4&list=PLhPyEFL5u-i2w2fa7ErcbkbEkjqLh7Io1&index=5
// added Form2.cs(WindowsForm)(Form2 Ref: Form2 f2 = new Form2();), listBox1(Form2.cs)(Prop:DataSource->addProjectDataSource->object->ERROR:noObject->Solution:Form2 Ref.AddedWithProp.), TextBox(Form2.cs)(Properties:Mutliline->True), button x3(Form2.cs),
namespace HeroMaker { public partial class Form1 : Form { //----START------- C# heromaker part 09 Picturebox control Visual Studio ------------------------------- // picture of hero string picture_of_hero = ""; //----END------- C# heromaker part 09 Picturebox control Visual Studio -------------------------------
}