Click here to Skip to main content
15,563,352 members
Home / Discussions / C#
   

C#

 
GeneralRe: i get an error (non-invocable member-- can't be used like a method) any help? Pin
Member 1289974620-Dec-16 3:01
Member 1289974620-Dec-16 3:01 
QuestionUnable to copy file "obj\x86\Debug\**** Pin
Rebyc Rebyc19-Dec-16 6:40
Rebyc Rebyc19-Dec-16 6:40 
AnswerRe: Unable to copy file "obj\x86\Debug\**** Pin
Richard Deeming19-Dec-16 6:57
mveRichard Deeming19-Dec-16 6:57 
AnswerRe: Unable to copy file "obj\x86\Debug\**** Pin
Afzaal Ahmad Zeeshan20-Dec-16 0:39
mveAfzaal Ahmad Zeeshan20-Dec-16 0:39 
QuestionC# Textbox number and symbols Pin
Pavlex418-Dec-16 7:12
Pavlex418-Dec-16 7:12 
AnswerRe: C# Textbox number and symbols Pin
Pavlex418-Dec-16 7:52
Pavlex418-Dec-16 7:52 
GeneralRe: C# Textbox number and symbols Pin
Pete O'Hanlon18-Dec-16 10:55
mvaPete O'Hanlon18-Dec-16 10:55 
AnswerRe: C# Textbox number and symbols Pin
Michael_Davies18-Dec-16 8:31
Michael_Davies18-Dec-16 8:31 
Build a string of allowed characters and test for the presence of the character entered, for instance to allow only numbers (apologise it is in VB but easy to convert);

VB.NET
Public Const IntegerStrings As String = "0123456789" + ChrW(8) ' Numbers & backspace

Public Sub IntegerKeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles tbHigh.KeyPress, tbLow.KeyPress
        '
        ' Ignore non-numeric keys
        '
        If IntegerStrings.IndexOf(e.KeyChar) = -1 Then
            e.Handled = True
        End If
    End Sub


Your difficulty arises when you are testing for a compound of digits like 75 and 50 in your example, for this you cannot use keypress but would have to test what was entered when the textbox is complete.
QuestionConfused Over EventListener, EventRaiser, CallBack Pin
Liagapi18-Dec-16 2:57
Liagapi18-Dec-16 2:57 
AnswerRe: Confused Over EventListener, EventRaiser, CallBack Pin
Richard MacCutchan18-Dec-16 6:32
mveRichard MacCutchan18-Dec-16 6:32 
QuestionC# Numbers game Pin
Pavlex417-Dec-16 2:17
Pavlex417-Dec-16 2:17 
AnswerRe: C# Numbers game Pin
OriginalGriff17-Dec-16 2:26
mvaOriginalGriff17-Dec-16 2:26 
GeneralRe: C# Numbers game Pin
Pavlex417-Dec-16 2:32
Pavlex417-Dec-16 2:32 
GeneralRe: C# Numbers game Pin
OriginalGriff17-Dec-16 2:52
mvaOriginalGriff17-Dec-16 2:52 
GeneralRe: C# Numbers game Pin
Pavlex417-Dec-16 2:56
Pavlex417-Dec-16 2:56 
GeneralRe: C# Numbers game Pin
OriginalGriff17-Dec-16 2:59
mvaOriginalGriff17-Dec-16 2:59 
GeneralRe: C# Numbers game Pin
Richard MacCutchan17-Dec-16 3:01
mveRichard MacCutchan17-Dec-16 3:01 
GeneralRe: C# Numbers game Pin
OriginalGriff17-Dec-16 3:12
mvaOriginalGriff17-Dec-16 3:12 
GeneralRe: C# Numbers game Pin
Richard MacCutchan17-Dec-16 3:31
mveRichard MacCutchan17-Dec-16 3:31 
GeneralRe: C# Numbers game Pin
OriginalGriff17-Dec-16 3:34
mvaOriginalGriff17-Dec-16 3:34 
GeneralRe: C# Numbers game Pin
Pavlex417-Dec-16 4:34
Pavlex417-Dec-16 4:34 
GeneralRe: C# Numbers game Pin
Richard MacCutchan17-Dec-16 5:21
mveRichard MacCutchan17-Dec-16 5:21 
GeneralRe: C# Numbers game Pin
OriginalGriff17-Dec-16 5:23
mvaOriginalGriff17-Dec-16 5:23 
GeneralRe: C# Numbers game Pin
Pavlex417-Dec-16 5:24
Pavlex417-Dec-16 5:24 
GeneralRe: C# Numbers game Pin
OriginalGriff17-Dec-16 5:37
mvaOriginalGriff17-Dec-16 5:37 

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.