Click here to Skip to main content
15,887,337 members
Home / Discussions / C#
   

C#

 
AnswerRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
Richard Deeming9-Apr-15 7:05
mveRichard Deeming9-Apr-15 7:05 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx9-Apr-15 7:24
professionaljkirkerx9-Apr-15 7:24 
AnswerRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
OriginalGriff9-Apr-15 21:47
mveOriginalGriff9-Apr-15 21:47 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx10-Apr-15 6:24
professionaljkirkerx10-Apr-15 6:24 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
OriginalGriff10-Apr-15 6:32
mveOriginalGriff10-Apr-15 6:32 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx10-Apr-15 7:36
professionaljkirkerx10-Apr-15 7:36 
QuestionParse XML Sibling Pin
antrock1019-Apr-15 6:23
antrock1019-Apr-15 6:23 
AnswerRe: Parse XML Sibling Pin
Richard Deeming9-Apr-15 6:39
mveRichard Deeming9-Apr-15 6:39 
Try something like this:
C#
public void URL_XML_Load()
{
   XmlDocument doc = new XmlDocument();
   doc.Load(...);

   foreach (XmlNode game in doc.SelectNodes("Data/Game"))
   {
      string id = game["id"].InnerText;
      string name = game["GameTitle"].InnerText;
      listBox1.Items.Add(new GameItem(id, name));
   }
}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
   GameItem selectedItem = (GameItem)listBox1.SelectedItem;
   id = selectedItem.Id;
   selectedGame = selectedItem.Name;
}

...

public sealed class GameItem
{
   public string Id { get; private set; }
   public string Name { get; private set; }

   public GameItem(string id, string name)
   {
      Id = id;
      Name = name;
   }

   public override string ToString()
   {
      return Name;
   }
}



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Parse XML Sibling Pin
antrock1019-Apr-15 9:22
antrock1019-Apr-15 9:22 
GeneralRe: Parse XML Sibling Pin
Richard Deeming9-Apr-15 10:02
mveRichard Deeming9-Apr-15 10:02 
AnswerRe: Parse XML Sibling Pin
surya tri13-Apr-15 2:21
surya tri13-Apr-15 2:21 
Questiongenerate a sequence of number prefixed with a character Pin
Jimmy-IN8-Apr-15 23:17
Jimmy-IN8-Apr-15 23:17 
AnswerRe: generate a sequence of number prefixed with a character Pin
Freak308-Apr-15 23:26
Freak308-Apr-15 23:26 
AnswerRe: generate a sequence of number prefixed with a character Pin
Pete O'Hanlon8-Apr-15 23:29
mvePete O'Hanlon8-Apr-15 23:29 
GeneralRe: generate a sequence of number prefixed with a character Pin
Jimmy-IN8-Apr-15 23:35
Jimmy-IN8-Apr-15 23:35 
GeneralRe: generate a sequence of number prefixed with a character Pin
Eddy Vluggen9-Apr-15 0:23
professionalEddy Vluggen9-Apr-15 0:23 
AnswerRe: generate a sequence of number prefixed with a character Pin
V.9-Apr-15 2:08
professionalV.9-Apr-15 2:08 
QuestionGet listbox text to show in richtextbox + custom text Pin
Googooli868-Apr-15 22:52
Googooli868-Apr-15 22:52 
Answer[REPOST] Pin
Sascha Lefèvre8-Apr-15 23:35
professionalSascha Lefèvre8-Apr-15 23:35 
QuestionHow do I filter PPID between oPsType.PPIDFrom and oPsType.PPIDTo, and pay_type in oPsType.PAY_TYPE Pin
Member 115045458-Apr-15 9:42
Member 115045458-Apr-15 9:42 
AnswerRe: How do I filter PPID between oPsType.PPIDFrom and oPsType.PPIDTo, and pay_type in oPsType.PAY_TYPE Pin
Mycroft Holmes8-Apr-15 14:19
professionalMycroft Holmes8-Apr-15 14:19 
QuestionToday's Async Question #2 Pin
Kevin Marois8-Apr-15 8:35
professionalKevin Marois8-Apr-15 8:35 
QuestionAnother Async Question Pin
Kevin Marois8-Apr-15 8:18
professionalKevin Marois8-Apr-15 8:18 
AnswerRe: Another Async Question PinPopular
Richard Deeming8-Apr-15 8:27
mveRichard Deeming8-Apr-15 8:27 
GeneralRe: Another Async Question Pin
Kevin Marois8-Apr-15 8:30
professionalKevin Marois8-Apr-15 8:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.