weird Vista only bug

BrandonMPSMI

Active member
Joined
Oct 8, 2008
Messages
43
Programming Experience
Beginner
My calculator works great... when you hit decimal it says "1." this is wonderful it works perfectly... in XP! If you use the same program in Vista it says ".1" but if you continue adding numbers it will put the decimal in the correct place... "1.23456" in XP you just type "1.2456" and it works perfectly.

It's as if it's a Vista only bug. Got any ideas? The calculator still performs perfectly it just looks strange when you have a decimal before the first number.
 
the code is copyrighted and it can't even begin to understand how it's in the code when it only happens when using WVista, on XP it works perfectly. But if it's absolutely necessary I guess I could give the decimal button code...
 
I'm not saying that there's anything specifically wrong with the code but how can we determine what the two OSes are doing differently if we don't know what they're doing? We have no magic.
 
the code is copyrighted and it can't even begin to understand how it's in the code when it only happens when using WVista, on XP it works perfectly. But if it's absolutely necessary I guess I could give the decimal button code...
Let me see if I've go this right: You have all kinds of your calculator code in your other threads on this forums and here you still have a problem with the program working correctly but you wont post the code that could cause the program because it's copyrighted.

What's to stop someone from duplicating your calculator from your other threads?
 
Okay forget the whole "I won't post code because it's copyrighted" Here's the code for just the decimal button.

VB.NET:
  Private Sub Button_Decimal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Decimal.Click
'MR is to signify if you pressed "memory recall twice"        
MR = False
        'If it is safe to add a number to the text box
        If testEqual = False Then
            If Not hasDecimal Then
                'Check to make sure the length is > than 1
                'Dont want user to add decimal as first character
                If TxtDisplay.Text.Length > 0 Then
                    'Adds a Decimal
                    If inputStatus = False Then
                        TxtDisplay.Text &= "."
                        hasDecimal = True
                        inputStatus = False
                    End If
                    'Adds a Zeroe and a Decimal
                    If inputStatus = True Then
                        TxtDisplay.Text = "0."
                        hasDecimal = True
                        inputStatus = False
                    End If
                Else
                    'Since the length isnt > 1
                    'make the text 0.
                    TxtDisplay.Text = "0."
                End If
            End If
        Else
            Total1 = 0
            Total2 = 0
            hasDecimal = False
            inputStatus = False
            calcFunc = ""
            PercentFunc = ""
            TxtDisplay.Text = ""
            testEqual = False
            TxtDisplay.Text = "0."
        End If
        Button_Equal.Focus()
    End Sub

Like I said... works fine on xp but vista is like ".1" instead of "1." if you press decimal before a number you get "0." on both OS.
 
I'm willing to bet it's the TxtDisplay.Text &= "." part.

How about this. TxtDisplay.Text += "."

Try it before you post.
 
I'm willing to bet it's the TxtDisplay.Text &= "." part.

How about this. TxtDisplay.Text += "."

Try it before you post.
That wouldn't change anything, since both sides are strings the += simply does string concatenation which is what &= is already doing.
 
Okay forget the whole "I won't post code because it's copyrighted" Here's the code for just the decimal button.

VB.NET:
  Private Sub Button_Decimal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_Decimal.Click
'MR is to signify if you pressed "memory recall twice"        
MR = False
        'If it is safe to add a number to the text box
        If testEqual = False Then
            If Not hasDecimal Then
                'Check to make sure the length is > than 1
                'Dont want user to add decimal as first character
                If TxtDisplay.Text.Length > 0 Then
                    'Adds a Decimal
                    If inputStatus = False Then
                        TxtDisplay.Text &= "."
                        hasDecimal = True
                        inputStatus = False
                    End If
                    'Adds a Zeroe and a Decimal
                    If inputStatus = True Then
                        TxtDisplay.Text = "0."
                        hasDecimal = True
                        inputStatus = False
                    End If
                Else
                    'Since the length isnt > 1
                    'make the text 0.
                    TxtDisplay.Text = "0."
                End If
            End If
        Else
            Total1 = 0
            Total2 = 0
            hasDecimal = False
            inputStatus = False
            calcFunc = ""
            PercentFunc = ""
            TxtDisplay.Text = ""
            testEqual = False
            TxtDisplay.Text = "0."
        End If
        Button_Equal.Focus()
    End Sub

Like I said... works fine on xp but vista is like ".1" instead of "1." if you press decimal before a number you get "0." on both OS.
Without seeing more of the code I don't see anything that would cause it to not work.

Also, have you tried stepping through the code line by line with it on the Vista comp?
 
Back
Top