Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can´t Create Unit Tests Pin
Luc Pattyn7-Jun-07 5:16
sitebuilderLuc Pattyn7-Jun-07 5:16 
GeneralRe: Can´t Create Unit Tests Pin
Bekjong7-Jun-07 5:18
Bekjong7-Jun-07 5:18 
GeneralRe: Can´t Create Unit Tests Pin
Dave Kreskowiak7-Jun-07 5:29
mveDave Kreskowiak7-Jun-07 5:29 
AnswerRe: Can´t Create Unit Tests Pin
Kevin McFarlane8-Jun-07 6:58
Kevin McFarlane8-Jun-07 6:58 
Questionhow to increate a number Pin
lockepeak7-Jun-07 4:23
lockepeak7-Jun-07 4:23 
AnswerRe: how to increate a number Pin
Rick van Woudenberg7-Jun-07 4:35
Rick van Woudenberg7-Jun-07 4:35 
GeneralRe: how to increate a number Pin
lockepeak7-Jun-07 16:37
lockepeak7-Jun-07 16:37 
GeneralRe: how to increate a number Pin
Rick van Woudenberg8-Jun-07 1:33
Rick van Woudenberg8-Jun-07 1:33 
well, I'm not sure what you're doing wrong but I just made a test project and it works perfect. Every single time I click the button , 1 is added to int i. What I think the problem is , is that you don't have the integer referenced properly in your application. You have to reference it throughout the entire form so that it remembers the previous value:

namespace Blah<br />
{<br />
   public partial class Form1 : Form<br />
    {<br />
        int i = 0;<br />
        public Form1()<br />
        {<br />
            InitializeComponent();<br />
        }<br />
        <br />
        private void button3_Click(object sender, EventArgs e)<br />
        {<br />
            i = (i + 1);<br />
            MessageBox.Show(i.ToString());<br />
            lbl.Text = i.ToString();  // optional<br />
        }<br />
<br />
     }<br />
   }<br />
}

if you reference int i anywhere else in the project, it will reset the value as soon as you dispose the messagebox. Intead of the messagebox, you could use a label to see the number increase everytime you click the button.

Hope this helped.
AnswerRe: how to increate a number Pin
DanB19837-Jun-07 4:36
DanB19837-Jun-07 4:36 
QuestionSimple array use, no looping = StackOverflowException? Pin
Christian Bailey7-Jun-07 4:14
Christian Bailey7-Jun-07 4:14 
AnswerRe: Simple array use, no looping = StackOverflowException? Pin
Mali Perica7-Jun-07 4:33
Mali Perica7-Jun-07 4:33 
AnswerRe: Simple array use, no looping = StackOverflowException? Pin
NassosReyzidis7-Jun-07 4:34
NassosReyzidis7-Jun-07 4:34 
AnswerRe: Simple array use, no looping = StackOverflowException? Pin
Ian Shlasko7-Jun-07 4:35
Ian Shlasko7-Jun-07 4:35 
GeneralRe: Simple array use, no looping = StackOverflowException? Pin
revi227-Jun-07 4:58
revi227-Jun-07 4:58 
AnswerRe: Simple array use, no looping = StackOverflowException? Pin
Christian Bailey7-Jun-07 10:30
Christian Bailey7-Jun-07 10:30 
QuestionThreadPool. Any way to know when all threads finished? Pin
Diego F.7-Jun-07 4:06
Diego F.7-Jun-07 4:06 
AnswerRe: ThreadPool. Any way to know when all threads finished? Pin
Dave Kreskowiak7-Jun-07 4:44
mveDave Kreskowiak7-Jun-07 4:44 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Diego F.7-Jun-07 4:52
Diego F.7-Jun-07 4:52 
AnswerRe: ThreadPool. Any way to know when all threads finished? Pin
Luc Pattyn7-Jun-07 4:50
sitebuilderLuc Pattyn7-Jun-07 4:50 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Diego F.7-Jun-07 4:56
Diego F.7-Jun-07 4:56 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Luc Pattyn7-Jun-07 5:13
sitebuilderLuc Pattyn7-Jun-07 5:13 
GeneralRe: ThreadPool. Any way to know when all threads finished? Pin
Dave Kreskowiak7-Jun-07 5:28
mveDave Kreskowiak7-Jun-07 5:28 
QuestionPassword Permission Pin
Saiyed Alam7-Jun-07 3:54
Saiyed Alam7-Jun-07 3:54 
AnswerRe: Password Permission Pin
Dave Kreskowiak7-Jun-07 4:38
mveDave Kreskowiak7-Jun-07 4:38 
GeneralRe: Password Permission Pin
Dan Neely7-Jun-07 7:31
Dan Neely7-Jun-07 7:31 

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.