Click here to Skip to main content
15,908,842 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Circle Packing Pin
Dave Sexton26-Oct-06 22:38
Dave Sexton26-Oct-06 22:38 
Questionhelp combobox Pin
Evalee26-Oct-06 17:26
Evalee26-Oct-06 17:26 
AnswerRe: help combobox Pin
Dave Sexton26-Oct-06 22:41
Dave Sexton26-Oct-06 22:41 
GeneralRe: help combobox Pin
Evalee27-Oct-06 0:36
Evalee27-Oct-06 0:36 
AnswerRe: help combobox Pin
Janani Divya27-Oct-06 1:49
Janani Divya27-Oct-06 1:49 
AnswerRe: help combobox Pin
Kschuler27-Oct-06 10:04
Kschuler27-Oct-06 10:04 
Questionkeypress to include the back space Pin
thefludragon26-Oct-06 15:42
thefludragon26-Oct-06 15:42 
AnswerRe: keypress to include the back space Pin
Xint026-Oct-06 17:28
Xint026-Oct-06 17:28 
Try this:

...
    If (e.KeyChar < '0' Or e.KeyChar > '9') And e.KeyChar <> '\b' Then
...


Additionally if using .NET 2.0 probably it would be better if you used PreviewKeyDown event:
Private Sub num_PreviewKeyDown(ByVal sender As Object, e As PreviewKeyDownEventArgs)
    e.IsInputKey = ((e.KeyCode = Keys.Back) And (e.Modifiers = 0)) Or ((e.KeyCode >= Keys.D0 Or e.KeyCode <= D9 Or e.KeyCode >= Keys.NumPad0 Or e.KeyCode <= Keys.NumPad9) And (e.Modifiers = 0))
End Sub


This way you can handle key combinations like Alt + 0, Ctrl + Backspace, etc.

If using .NET 1.1 then use KeyDown to set a flag and check the flag value on the KeyPress event to set the Handled property.

- Xint0

QuestionVB.Net 2003 and VB6 Pin
Mekong River26-Oct-06 15:12
Mekong River26-Oct-06 15:12 
AnswerRe: VB.Net 2003 and VB6 Pin
Kevin McFarlane27-Oct-06 3:52
Kevin McFarlane27-Oct-06 3:52 
QuestionVery Urgent!!! Deadline!!! Pin
UltraCoder26-Oct-06 12:43
UltraCoder26-Oct-06 12:43 
AnswerRe: Very Urgent!!! Deadline!!! Pin
Dave Kreskowiak27-Oct-06 5:48
mveDave Kreskowiak27-Oct-06 5:48 
AnswerRe: Very Urgent!!! Deadline!!! Pin
Dave Kreskowiak27-Oct-06 5:54
mveDave Kreskowiak27-Oct-06 5:54 
QuestionUnload Close Command Pin
UltraCoder26-Oct-06 11:27
UltraCoder26-Oct-06 11:27 
AnswerRe: Unload Close Command Pin
Dave Kreskowiak26-Oct-06 18:02
mveDave Kreskowiak26-Oct-06 18:02 
QuestionResolving Excel Open Processes after ADO Connection Pin
pao_e_vinho26-Oct-06 8:57
pao_e_vinho26-Oct-06 8:57 
QuestionVB 2005 Pin
Pete Newman26-Oct-06 8:52
Pete Newman26-Oct-06 8:52 
QuestionTextBox Property Pin
andy3826-Oct-06 7:38
andy3826-Oct-06 7:38 
AnswerRe: TextBox Property [modified] Pin
AlexeiXX326-Oct-06 8:21
AlexeiXX326-Oct-06 8:21 
AnswerRe: TextBox Property Pin
ADY00726-Oct-06 8:56
ADY00726-Oct-06 8:56 
GeneralRe: TextBox Property Pin
Dave Kreskowiak26-Oct-06 10:02
mveDave Kreskowiak26-Oct-06 10:02 
QuestionPrinting a Form Pin
dptalt26-Oct-06 7:00
dptalt26-Oct-06 7:00 
AnswerRe: Printing a Form Pin
Dave Kreskowiak26-Oct-06 7:56
mveDave Kreskowiak26-Oct-06 7:56 
GeneralRe: Printing a Form Pin
dptalt26-Oct-06 8:25
dptalt26-Oct-06 8:25 
QuestionDelete key in table fields doesnt work? Pin
Muntyness26-Oct-06 6:46
Muntyness26-Oct-06 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.