Click here to Skip to main content
15,905,874 members
Home / Discussions / C#
   

C#

 
GeneralRe: Object Null/Empty Check Pin
DaveyM6915-Jun-10 1:07
professionalDaveyM6915-Jun-10 1:07 
AnswerRe: Object Null/Empty Check Pin
Eddy Vluggen14-Jun-10 23:04
professionalEddy Vluggen14-Jun-10 23:04 
QuestionAuto Generate Row Number [solved] Pin
Elango N14-Jun-10 22:12
Elango N14-Jun-10 22:12 
AnswerRe: Auto Generate Row Number Pin
Peace ON14-Jun-10 22:29
Peace ON14-Jun-10 22:29 
Questionhow I could save apicture in sql and bring it to a form in C#? Pin
ronakT14-Jun-10 21:34
ronakT14-Jun-10 21:34 
AnswerRe: how I could save apicture in sql and bring it to a form in C#? Pin
Abhinav S14-Jun-10 22:12
Abhinav S14-Jun-10 22:12 
QuestionHaving A Spot Of Trouble With Events Pin
Roger Wright14-Jun-10 19:48
professionalRoger Wright14-Jun-10 19:48 
AnswerRe: Having A Spot Of Trouble With Events Pin
TheFoZ14-Jun-10 21:28
TheFoZ14-Jun-10 21:28 
Hi Roger.

I'm having trouble recreating your problem. I shoved two text boxes on a form and used the following code:-

double prev;
double dim1;

private void txtDim1_Leave(object sender, EventArgs e)
{
    prev = dim1;
    dim1 = ValidateEntry(txtDim1);

    if (dim1 != 0.0 & prev != dim1)
    {
        MessageBox.Show("Event Fired");
    }

}

private double ValidateEntry(TextBox MyTextBox)
{
    try
    {
        return Double.Parse(MyTextBox.Text);
    }
    catch (FormatException ex)
    {
        MessageBox.Show("Enter a valid numeric value" + ex.Message);
        MyTextBox.Focus(); return 0.0;
    }
}

private void txtDim1_KeyPress(object sender, KeyPressEventArgs e)
{
    if (e.KeyChar == 13) { txtDim2.Focus(); }
}

and it worked as expected. Is there anywhere else in your code that you could be changing the value of txtDim1.
The FoZ

GeneralRe: Having A Spot Of Trouble With Events Pin
Roger Wright15-Jun-10 7:06
professionalRoger Wright15-Jun-10 7:06 
AnswerRe: Having A Spot Of Trouble With Events Pin
DaveyM6914-Jun-10 22:21
professionalDaveyM6914-Jun-10 22:21 
QuestionTrackBar Pin
Nicolás Marzoni14-Jun-10 17:32
Nicolás Marzoni14-Jun-10 17:32 
AnswerRe: TrackBar Pin
Calla14-Jun-10 19:32
Calla14-Jun-10 19:32 
GeneralRe: TrackBar Pin
Nicolás Marzoni15-Jun-10 1:28
Nicolás Marzoni15-Jun-10 1:28 
GeneralRe: TrackBar Pin
DaveyM6915-Jun-10 1:31
professionalDaveyM6915-Jun-10 1:31 
GeneralRe: TrackBar Pin
Nicolás Marzoni15-Jun-10 1:36
Nicolás Marzoni15-Jun-10 1:36 
GeneralRe: TrackBar Pin
DaveyM6915-Jun-10 2:39
professionalDaveyM6915-Jun-10 2:39 
GeneralRe: TrackBar Pin
DaveyM6915-Jun-10 2:40
professionalDaveyM6915-Jun-10 2:40 
GeneralRe: TrackBar - Long post alert! Pin
DaveyM6915-Jun-10 10:17
professionalDaveyM6915-Jun-10 10:17 
QuestionAsp.Net MVC2 in VS 2010 Pin
Darrall14-Jun-10 12:03
Darrall14-Jun-10 12:03 
AnswerRe: Asp.Net MVC2 in VS 2010 Pin
Al Beback14-Jun-10 17:15
Al Beback14-Jun-10 17:15 
GeneralRe: Asp.Net MVC2 in VS 2010 Pin
Darrall15-Jun-10 3:37
Darrall15-Jun-10 3:37 
Questioncreating an unsafe array in C# Pin
Keith Vitali14-Jun-10 10:45
Keith Vitali14-Jun-10 10:45 
AnswerRe: creating an unsafe array in C# Pin
Luc Pattyn14-Jun-10 10:56
sitebuilderLuc Pattyn14-Jun-10 10:56 
GeneralRe: creating an unsafe array in C# Pin
Keith Vitali15-Jun-10 3:40
Keith Vitali15-Jun-10 3:40 
GeneralRe: creating an unsafe array in C# Pin
Luc Pattyn15-Jun-10 3:45
sitebuilderLuc Pattyn15-Jun-10 3:45 

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.