Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2003, 11:16 AM
Authorized User
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default making calculator help

I'm making the calculator similar to the windows one (standard)

I have problems with 2 functions one is button , (for making decimals) and function that will prevent someone to paste text into the txtbox.

Please someone help me

 
Old December 31st, 2003, 11:36 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What exactly are your problems? Are you unclear on how to create these functions? You need to provide a little more detail.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 31st, 2003, 01:32 PM
Authorized User
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well i have no clue about the code for , button

and i have some problems with the code for txtbox and don't know what function and syntax to use, i did make it to prevent somebody to enter text but i don't know how to make it prevent text pasting.(i need a function that looks at txtbox when somebody pastes into it, it starts and checks the entry and if non numerical string was entered it deletes txtbox)

 
Old January 4th, 2004, 12:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this.

dim a as integer
a=instr(display.text,".")

if a = 0 then
display.text = display.text + dot.text
else
display.text = display.text
end if



display.text it is textbox name
dot.text it is dot button name



Quote:
quote:Originally posted by bcmaverik
 well i have no clue about the code for , button

and i have some problems with the code for txtbox and don't know what function and syntax to use, i did make it to prevent somebody to enter text but i don't know how to make it prevent text pasting.(i need a function that looks at txtbox when somebody pastes into it, it starts and checks the entry and if non numerical string was entered it deletes txtbox)

 
Old January 4th, 2004, 06:48 AM
Authorized User
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cool works but there is a little problem you can make 5 commas and you get the error

 
Old January 4th, 2004, 06:52 AM
Authorized User
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

solved

instead of a=instr(display.text,".") you have to write a=instr(display.text,",")

tnx a lot


anyone knows how to make someone to prevent pasting text and only allowing numbers to be pasted in txtbox
 
Old January 6th, 2004, 12:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

How about the IsNumeric function to make sure it is a number?

J
 
Old January 6th, 2004, 11:42 AM
Authorized User
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

tnx i made it and it works






Similar Threads
Thread Thread Starter Forum Replies Last Post
calculator mojtaba rashidi Visual Studio 2005 0 March 17th, 2008 07:29 AM
Scientific calculator NEO1976 Flash (all versions) 2 November 28th, 2007 10:59 AM
Calculator DweeLer Other Programming Languages 1 November 18th, 2005 08:13 AM
Making a LRC calculator in Excel? wilded Excel VBA 3 March 25th, 2005 04:47 PM
calculator kale_tushar C++ Programming 1 January 28th, 2004 01:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.