0

Guys i need help or tips about allowing only one dot in calculator and i'm using button. could you guys provide me some tips on how to do it?

Thank you in advance.

3
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by Jake.20
0

I believe what he is saying is when he presses the . key on his calculator multiple times, it adds more then one .

As tinstaafl says, please post code on what you have done to attempt to accomplish this.

1

try this, assuming the display is a textbox, in the click event for the '.' button:

If Instr(Text1.Text,".")= 0 Then
    Text1.Text = Text1.Text + "."
End If
Votes + Comments
Very useful!
0

Thank you tinstaafl! i tried to do the same code in vb 2010 but it didn't work. XD didn't know that vb 6 and 2008-2010 is different.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.