Click here to Skip to main content
15,885,216 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Anyone familiar with Ozgur Ozcitak ImageListView control ? Pin
Gerry Schmitz3-Feb-21 6:32
mveGerry Schmitz3-Feb-21 6:32 
QuestionTCPIP SOCKET DATA RECEIVE FROM INSTRUMENT Pin
cws_ap1-Feb-21 0:19
cws_ap1-Feb-21 0:19 
Question.NET Core Web API hosting docker Pin
johncodeproject15-Jan-21 16:25
johncodeproject15-Jan-21 16:25 
QuestionApply formatting on multiple Text boxes within a Group box. Pin
Interplain11-Jan-21 0:25
Interplain11-Jan-21 0:25 
AnswerRe: Apply formatting on multiple Text boxes within a Group box. Pin
Pete O'Hanlon11-Jan-21 2:45
mvePete O'Hanlon11-Jan-21 2:45 
GeneralRe: Apply formatting on multiple Text boxes within a Group box. Pin
Interplain11-Jan-21 3:00
Interplain11-Jan-21 3:00 
GeneralRe: Apply formatting on multiple Text boxes within a Group box. Pin
Gerry Schmitz11-Jan-21 5:05
mveGerry Schmitz11-Jan-21 5:05 
AnswerRe: Apply formatting on multiple Text boxes within a Group box. Pin
Richard Deeming11-Jan-21 22:14
mveRichard Deeming11-Jan-21 22:14 
As Pete suggested:
VB.NET
Private Sub NumericTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles RollTemp_BOTTextBox.KeyPress, OtherTextBox.KeyPress, YetAnotherTextBox.KeyPress
    Dim keyChar = e.KeyChar
    If Char.IsControl(keyChar) Then
        'Allow all control characters.
    ElseIf Char.IsDigit(keyChar) OrElse keyChar = "."c Then
        Dim box As TextBox = DirectCast(sender, TextBox)
        Dim text As String = box.Text
        Dim selectionStart As Integer = box.SelectionStart
        Dim selectionLength As Integer = box.SelectionLength
        text = text.Substring(0, selectionStart) & keyChar & text.Substring(selectionStart + selectionLength)
        
        Dim valueInt32 As Integer
        Dim valueDouble As Double
        
        If Integer.TryParse(text, valueInt32) AndAlso valueInt32 > 999 Then
            ' Reject an integer that is longer than 3 digits.
            e.Handled = True
        ElseIf Double.TryParse(text, valueDouble) AndAlso text.IndexOf("."c) < text.Length - 4 Then
            ' Reject a real number with two many decimal places.
            e.Handled = True
        End If
    Else
        ' Reject all other characters.
        e.Handled = True
    End If
End Sub
How to: Connect Multiple Events to a Single Event Handler - Windows Forms .NET Framework | Microsoft Docs[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Apply formatting on multiple Text boxes within a Group box. Pin
Interplain12-Jan-21 0:56
Interplain12-Jan-21 0:56 
AnswerRe: Apply formatting on multiple Text boxes within a Group box. Pin
Ralf Meier12-Jan-21 2:40
mveRalf Meier12-Jan-21 2:40 
QuestionProblem with Calling builded exe from another form Pin
Member 149553323-Jan-21 0:38
Member 149553323-Jan-21 0:38 
AnswerRe: Problem with Calling builded exe from another form Pin
Victor Nijegorodov3-Jan-21 3:36
Victor Nijegorodov3-Jan-21 3:36 
GeneralRe: Problem with Calling builded exe from another form Pin
Member 149553326-Jan-21 9:38
Member 149553326-Jan-21 9:38 
GeneralRe: Problem with Calling builded exe from another form Pin
Victor Nijegorodov6-Jan-21 9:51
Victor Nijegorodov6-Jan-21 9:51 
GeneralRe: Problem with Calling builded exe from another form Pin
Richard MacCutchan6-Jan-21 22:52
mveRichard MacCutchan6-Jan-21 22:52 
QuestionHelp for a school Project Pin
Member 1502795822-Dec-20 4:48
Member 1502795822-Dec-20 4:48 
AnswerRe: Help for a school Project Pin
Ralf Meier26-Dec-20 23:13
mveRalf Meier26-Dec-20 23:13 
QuestionHow can I setup connectionstring to a webroot dir Pin
Nguyễn Tuấn Anh 9216-Dec-20 18:22
Nguyễn Tuấn Anh 9216-Dec-20 18:22 
QuestionSpecification Pattern for validations Pin
TimWallace25-Nov-20 20:23
TimWallace25-Nov-20 20:23 
AnswerRe: Specification Pattern for validations Pin
Gerry Schmitz26-Nov-20 5:56
mveGerry Schmitz26-Nov-20 5:56 
GeneralRe: Specification Pattern for validations Pin
TimWallace27-Nov-20 15:07
TimWallace27-Nov-20 15:07 
General.Net 5 Performance Improvements Pin
GerVenson24-Nov-20 3:56
professionalGerVenson24-Nov-20 3:56 
GeneralRe: .Net 5 Performance Improvements Pin
Gerry Schmitz27-Nov-20 5:56
mveGerry Schmitz27-Nov-20 5:56 
QuestionInterested in a VB.Net Winforms Master/Detail DataGridView with RichTextBox Cell/Column? Pin
Jo_vb.net15-Nov-20 11:36
mvaJo_vb.net15-Nov-20 11:36 
QuestionMaster/Detail GridView - issue with the some keys not working Pin
Jo_vb.net11-Nov-20 7:09
mvaJo_vb.net11-Nov-20 7:09 

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.