Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
QuestionWebClient cannot DownLoadFile error Pin
yu-jian11-Nov-10 17:11
yu-jian11-Nov-10 17:11 
AnswerRe: WebClient cannot DownLoadFile error Pin
Luc Pattyn11-Nov-10 17:25
sitebuilderLuc Pattyn11-Nov-10 17:25 
QuestionData labels ? Pin
SRJ9211-Nov-10 12:01
SRJ9211-Nov-10 12:01 
AnswerRe: Data labels ? Pin
Dave Kreskowiak11-Nov-10 12:56
mveDave Kreskowiak11-Nov-10 12:56 
AnswerRe: Data labels ? Pin
Henry Minute11-Nov-10 12:58
Henry Minute11-Nov-10 12:58 
GeneralRe: Data labels ? Pin
SRJ9211-Nov-10 13:32
SRJ9211-Nov-10 13:32 
GeneralRe: Data labels ? Pin
SRJ9213-Nov-10 13:56
SRJ9213-Nov-10 13:56 
GeneralRe: Data labels ? Pin
Henry Minute13-Nov-10 14:19
Henry Minute13-Nov-10 14:19 
Something like:

C#
Label nameLabel = null;
Label scoreLabel = null;
int nameX = 10;
int nameY = 10;
readonly int nameWidth = 70;  // Change this value to alter the spacing adjust scoreX accordingly, if you do
int scoreX = 85;
int scoreY = 10;
int listCount = 1;
foreach(DataRow row in dt.Rows)
{
  nameLabel = new Label();  // Create the label
  nameLabel.Width = nameWidth;  // set its width (use a variable so that you can just alter that value to change the layout)
  nameLabel.Text = row["PlayerName"].Value.ToString(); // you might need to check for null here, depends on your data.
  nameLabel.Location = new Point(nameX, nameY);
  this.Controls.Add(nameLabel)
  nameY += nameLabel.Height + 5; // add 5 for spacing. You could use a variable as for the width. The X value stays the same so that the left edges line up

  // Do the same for scoreLabel
  ........................
  ........................
  ........................
  ........................

  listCount++;
  if (listCount > 10) // to ensure only the 10 as per your original post.
  {
    break;
  }
}


That is roughly right but I'm doing it off the top of my head and it is very late here, so forgive any syntax errors.

Good luck. Smile | :)
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

GeneralRe: Data labels ? Pin
SRJ9214-Nov-10 1:54
SRJ9214-Nov-10 1:54 
QuestionManaging Connection Strings Pin
Kevin Marois11-Nov-10 9:00
professionalKevin Marois11-Nov-10 9:00 
AnswerRe: Managing Connection Strings Pin
OriginalGriff11-Nov-10 9:10
mveOriginalGriff11-Nov-10 9:10 
GeneralRe: Managing Connection Strings Pin
Kevin Marois11-Nov-10 9:15
professionalKevin Marois11-Nov-10 9:15 
GeneralRe: Managing Connection Strings Pin
OriginalGriff11-Nov-10 9:24
mveOriginalGriff11-Nov-10 9:24 
GeneralRe: Managing Connection Strings Pin
Kevin Marois11-Nov-10 9:29
professionalKevin Marois11-Nov-10 9:29 
GeneralRe: Managing Connection Strings Pin
Not Active11-Nov-10 10:11
mentorNot Active11-Nov-10 10:11 
GeneralRe: Managing Connection Strings Pin
Not Active11-Nov-10 10:13
mentorNot Active11-Nov-10 10:13 
AnswerRe: Managing Connection Strings Pin
PIEBALDconsult11-Nov-10 14:47
mvePIEBALDconsult11-Nov-10 14:47 
QuestionHow i can to activate a method automatically like a task programed Pin
msaez11-Nov-10 5:01
msaez11-Nov-10 5:01 
AnswerRe: How i can to activate a method automatically like a task programed Pin
OriginalGriff11-Nov-10 5:07
mveOriginalGriff11-Nov-10 5:07 
AnswerRe: How i can to activate a method automatically like a task programed Pin
Luc Pattyn11-Nov-10 6:18
sitebuilderLuc Pattyn11-Nov-10 6:18 
GeneralRe: How i can to activate a method automatically like a task programed Pin
Lutosław11-Nov-10 9:59
Lutosław11-Nov-10 9:59 
AnswerRe: How i can to activate a method automatically like a task programed Pin
Eddy Vluggen11-Nov-10 10:04
professionalEddy Vluggen11-Nov-10 10:04 
QuestionDummy question, when i close the GUI from the "X" from upper left corner, how to call another function ? Pin
588311-Nov-10 4:11
588311-Nov-10 4:11 
AnswerRe: Dummy question, when i close the GUI from the "X" from upper left corner, how to call another function ? PinPopular
Lutosław11-Nov-10 4:17
Lutosław11-Nov-10 4:17 
GeneralRe: Dummy question, when i close the GUI from the "X" from upper left corner, how to call another function ? [modified] Pin
Jeff Connelly15-Nov-10 11:07
Jeff Connelly15-Nov-10 11:07 

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.