Danikashi's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Members
Active Posts:
20 (0.03 per day)
Joined:
11-May 12
Profile Views:
231
Last Active:
User is offline Jan 20 2013 09:18 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   Danikashi has not set their status

Posts I've Made

  1. In Topic: [WinForms] Value goes missing

    Posted 18 Jan 2013

    I'm testing a label, if that label has an blank space(" ") in it, it changes the label text to an "X" the counter goes +1 and when it reaches 5 or 2 depending if i'm testing for the stars(2) or the numbers(5), it pops up a messagebox saying so.
    I don't see any error on the one i wrote either, maybe its because global vars and functions have conflits?
  2. In Topic: [WinForms] Value goes missing

    Posted 18 Jan 2013

    Yeah i know i could do "return staph" only... it was to see if it was any return error. Yeah i tried using debug still couldnt find it, it simply resets "cont" to 0.
    After i call the function and it "returns" the value the cont resets back to 0.
    It can be both 5 or 2 depending on the parameter you use in the function, i'm doing "euromillions".
  3. In Topic: [WinForms] Value goes missing

    Posted 18 Jan 2013

    View Postb0zhidar, on 18 January 2013 - 02:29 AM, said:

    If you posted any code it would be much easier to help you, like this, we have no idea how your code looks.

    My bad.
        public int Numbers(Label lbl, int staph, int k)
            {
                int kk;
                if (lbl.Text == "X")
                {
                    lbl.BackColor = Color.Transparent;
                    lbl.Text = " ";
    
                    staph--;
                    MessageBox.Show(cont.ToString());
                }
                else
                    if (cont == k)
                    {
                        if (k == 5)
                        {
                            MessageBox.Show("Ja inseriu 5 Numeros", "Warning");
                        }
                        else
                        {
                            MessageBox.Show("Ja inseriu 2 Estrelas", "Warning");
                        }
                    }
                    else
                        if (lbl.Text != "X")
                        {
                            lbl.BackColor = Color.White;
                            lbl.Text = "X";
                            staph++;
                            MessageBox.Show(staph.ToString());
                        }
                kk = staph;
                return kk;
    }
    
  4. In Topic: [WinForms] Concatenation of a Label and a Variable

    Posted 15 Jan 2013

    View Postmodi123_1, on 15 January 2013 - 03:14 PM, said:

    Well that was a round about way of explaining things, but in that cause use teh 'controls' collection... you can reference a control by it's name.

                string lblConstant = "label";
                int barbar = 1;
                this.Controls[lblConstant + barbar.ToString()].Name = "poot";
    


    Worked. I'm currently studying C# so i didn't know of the "Controls".
    Thank you for your time :)
  5. In Topic: [WinForms] Concatenation of a Label and a Variable

    Posted 15 Jan 2013

    View Postmodi123_1, on 15 January 2013 - 03:02 PM, said:

    Quote

    I want to choose the label that the random gives me and change its text.

    How can you choose something the random object gives you?


    For example i have 5 labels. named label1,label2,etc... i get an random number (from 1 to 5) and then i use that number to choose the label. If i get the number 3 i will use the label3 if i get the number 1 i will use the label1 and so on.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Danikashi hasn't added any friends yet.

Comments

Danikashi has no profile comments yet. Why not say hello?