473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Visual Basic Electric Billing program

Hello friends. I am Jessie from the Philippines. Friends my problem is how to restrict my textbox so that the users cannot encode a letter.
Sep 28 '07 #1
5 4577
Killer42
8,435 Expert 8TB
Hello friends. I am Jessie from the Philippines. Friends my problem is how to restrict my textbox so that the users cannot encode a letter.
This has been covered in a couple of recent posts here. But probably your simplest solution is to use a Masked Edit control, which allows you to control the format of the input.

Otherwise, you can filter out the keys you don't want by intercepting them in the KeyDown event procedure.
Sep 28 '07 #2
jamesd0142
469 256MB
Code may be slightly incorrect but the idea is here...

on form keypress function,

if e.keychar() <> "0" | "1" | "2".......| "9" then
msgbox("please only use digits")
end if
Sep 28 '07 #3
QVeen72
1,445 Expert 1GB
Hi,

Write this code in KeyPress Event of textbox :

Expand|Select|Wrap|Line Numbers
  1. Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  2.     If IsNumeric(e.KeyChar) Then
  3.         e.Handled = False
  4.     Else
  5.         e.Handled = True
  6.     End If
  7. End Sub
  8.  

REgards
Veena
Sep 28 '07 #4
Luzuko
8
Hi ,

i just want to thank you for the piece of code i got from you.
it's working perfectly on VB 2005 controls, however we're building our controls using Microsoft expression-Blend(user interface) and then program the user interface via Vb 2005. Now the problem is that the keypressed event doesn't show when we use the code on our User interface. Do you know any other event we can use for that code.
Oct 6 '07 #5
QVeen72
1,445 Expert 1GB
Hi,

You can check in Changed Event of the textbox, it fires whenever you add/edit/delete anything in a textbox, maybe you may have to modify a bit.

Regards
Veena
Oct 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AK | last post by:
I don't want any part of the previous discussion on Visual Basic versus Visual Basic.Net. My query is about using Visual Basic for Applications; and whether it is better to use Visual Basic 6 or...
2
by: Scott | last post by:
Not sure if this is the right place to post this or not, but I am in the process of trying to find a Web Hosting/Isp Billing system that is reasonable in price and uses Access or SQL Server for a...
2
by: janice_2k | last post by:
Dear Sir/Mdm, I am writing this on behalf of my company. We bought the Visual Studio .NET Enterprise version but currently we need to use Visual Basic 6 for a small development. We are not able to...
2
by: Ralph | last post by:
I used to have Visual Basic .net std. 2003 installed on WinXP SP1A. But I found it too hard to upgrade WinXP to SP2. Now, I do have WinXP SP2 installed, but I am having problems installing...
18
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
2
by: frossberg | last post by:
Hello! I tried to install the Visual Basic.NET Resource Kit (http://msdn.microsoft.com/vbasic/vbrkit/) but obviously something went very wrong and now it sems impossible both to repair and to...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
6
by: DanielJohnson | last post by:
int main() { printf("\n Hello World"); main; return 0; } This program terminate just after one loop while the second program goes on infinitely untill segmentation fault (core dumped) on...
1
by: vai | last post by:
hi all, i'm developing a stock management system. in this system i'm developing a billing system which on daily & monthly basis. i'm using ms-acess database as backend & visual baic as front end....
1
by: kuleamo | last post by:
I designing a client / server system for internet billing using visual basic 2005. I had a problem with locking the client screen when not in use, how can i do this ?
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.