How do i add a parameter to a label?
Hi everyone, I am trying to create a simple nation simulator game. I created a "Nations" class with military, diplomatic and industry properties. I instantiated an object called "Italy" from the nations class, and i assigned a value to the properties i created before. Now i would like to change the text of a label to the military score of the object "Italy" LblMil_Score.Text=Italy.mil; The problem is that this doesn't work. Can someone tell me how to change the value of the label to the value of the property? Thanks FULL CODE: Nations class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Nation_Simulator { public class Nations { public string name { get; set; } public string TypeOfGovernment { get; set; } public string RulingParty { get; set; } public string HeadOfState { get; set; } public int military { get; set; } public int diplomacy { get; set; } public int industry { get; set; } public int prestige { get; set; } public byte stability { get; set; } public Nations(string Name, string Government, string Party, string HeadState, int mil, int dip, int ind, int prest, byte stab) { name = Name; TypeOfGovernment = Government; RulingParty = Party; HeadOfState = HeadState; military = mil; diplomacy = dip; industry = ind; prestige = prest; stability = stab; } Nations Italy = new Nations("Italy", "Authoritarianism", "Partito Nazionale Fascista", "Vittorio Emanuele III", 300, 700, 750, 400, 3); } }