c# question menu

User Tag List

Thread: c# question

Results 1 to 4 of 4
  1. #1
    uzzy13u's Avatar Active Member
    Reputation
    40
    Join Date
    Oct 2008
    Posts
    99
    Thanks G/R
    21/20
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    c# question

    // edit - removed
    Last edited by uzzy13u; 03-24-2022 at 07:26 AM.

    c# question
  2. #2
    Willy's Avatar Elite User
    CoreCoins Purchaser
    Reputation
    478
    Join Date
    Mar 2007
    Posts
    682
    Thanks G/R
    147/124
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. This is the entirely wrong section, surely you must have noticed that this section says "WoW EMU Questions & Requests".
    2. We do have a programming section.

    3. Your actual problem: You keep writing over "nr" in your forloop and then AFTER the loop you try to add the nr-th element of savenames to the grid. You have to do that inside your loop. And that's only half of the problem, you do the same thing in your first for-loop so that savenames will only contain cat and nothing else.

    Given the simplicity of this problem I believe that you should read up on loops, variable initialization and about general programming control flow.
    Last edited by Willy; 02-21-2017 at 08:29 AM.

  3. Thanks uzzy13u (1 members gave Thanks to Willy for this useful post)
  4. #3
    kataldt's Avatar Active Member
    Reputation
    40
    Join Date
    Jun 2008
    Posts
    246
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why do you need savenames, nr, or countHowManynamesAre? Is this a specific assignment requirement?

    Can you just do:

    Code:
    foreach (string n in name) dataGridView1.Rows.Add(n);
    Apologies if not, I don't work with Winforms much at all, mostly .Net backend stuff.

    Problems I can see at a glance:

    "savenames" is just the last item in your List, since you're reassigning it every time you iterate.

    You don't need "countHowmanynamesAre" at all, you can just directly reference name.Count.

    The entire for loop is just counting your list length, and then assigning the current count to another number... again you can just reference name.Count directly, although I don't know if that's what you're trying to do.

  5. Thanks uzzy13u, stoneharry (2 members gave Thanks to kataldt for this useful post)
  6. #4
    uzzy13u's Avatar Active Member
    Reputation
    40
    Join Date
    Oct 2008
    Posts
    99
    Thanks G/R
    21/20
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    // edit - removed
    Last edited by uzzy13u; 03-24-2022 at 07:26 AM.

Similar Threads

  1. Model Changing Question
    By MasterYuke in forum World of Warcraft General
    Replies: 6
    Last Post: 09-17-2006, 09:56 PM
  2. Couple Private Server questions
    By Jboz in forum World of Warcraft General
    Replies: 21
    Last Post: 07-26-2006, 07:37 PM
  3. Sorry..newb mail question
    By nolbishop in forum World of Warcraft General
    Replies: 2
    Last Post: 06-07-2006, 07:21 PM
  4. Question..
    By janzi9 in forum Community Chat
    Replies: 3
    Last Post: 04-02-2006, 10:20 AM
  5. A GALB question
    By bassman in forum World of Warcraft General
    Replies: 4
    Last Post: 03-28-2006, 09:49 AM
All times are GMT -5. The time now is 09:19 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search