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.

Recommended Answers

All 4 Replies

what code have you got so far? and what is it doing wrong?

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.

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
commented: Very useful! +2

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.