Click here to Skip to main content
16,021,580 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: My.Computer.Network.DownloadFile Pin
Dave Kreskowiak12-Mar-07 12:37
mveDave Kreskowiak12-Mar-07 12:37 
AnswerRe: My.Computer.Network.DownloadFile Pin
tgebrael12-Mar-07 18:07
tgebrael12-Mar-07 18:07 
QuestionMr. Mogtabam please check.. Pin
manni_n12-Mar-07 9:47
manni_n12-Mar-07 9:47 
AnswerRe: Mr. Mogtabam please check.. Pin
kubben12-Mar-07 9:55
kubben12-Mar-07 9:55 
GeneralRe: Mr. Mogtabam please check.. Pin
manni_n12-Mar-07 10:59
manni_n12-Mar-07 10:59 
GeneralRe: Mr. Mogtabam please check.. Pin
kubben12-Mar-07 13:55
kubben12-Mar-07 13:55 
Generalits working Pin
manni_n14-Mar-07 8:27
manni_n14-Mar-07 8:27 
GeneralRe: Mr. Mogtabam please check.. [modified] Pin
TwoFaced12-Mar-07 22:00
TwoFaced12-Mar-07 22:00 
I think as a user I would be annoyed if I got a message everytime I typed in a number greater then 45. The way you have it set up I could type in 12 then accidentally hit 3, thus having 123 in the box, and I would get a warning in addition to the value being reset to 0. I think you should just stop the key from being pressed if it will result in to large a value. This way the user can't type in a larger number and you avoid the warning and clearing the value simply because I hit an extra character on my keyboard. Here is the code to handle that.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
    If Char.IsDigit(e.KeyChar) Then
        'Key was a digit
        Dim txtBox As TextBox = DirectCast(sender, TextBox)
        Dim value As Integer
        Dim newText As String = txtBox.Text.Remove(txtBox.SelectionStart, txtBox.SelectionLength)
        newText = newText.Insert(txtBox.SelectionStart, e.KeyChar.ToString)

        'If value of textbox will be greater then 45 ignore key
        If Integer.TryParse(newText, value) Then
            If value > 45 Then e.Handled = True
        End If
    ElseIf Not Char.IsControl(e.KeyChar) Then
        'Ignore key: It wasn't digit, backspace, enter, or delete
        e.Handled = True
    End If
End Sub

GeneralRe: Mr. Mogtabam please check.. Pin
TwoFaced12-Mar-07 22:19
TwoFaced12-Mar-07 22:19 
AnswerRe: Mr. Mogtabam please check.. Pin
nlarson1112-Mar-07 10:53
nlarson1112-Mar-07 10:53 
AnswerRe: Mr. Mogtabam please check.. Pin
Mogtabam13-Mar-07 1:13
Mogtabam13-Mar-07 1:13 
QuestionCrystal Reports Dynamic Parameter Support within vb.net Pin
manisghouri12-Mar-07 8:45
manisghouri12-Mar-07 8:45 
QuestionPicturebox Control Question Pin
JohanSturk12-Mar-07 7:08
JohanSturk12-Mar-07 7:08 
AnswerRe: Picturebox Control Question Pin
M-Hall12-Mar-07 7:42
M-Hall12-Mar-07 7:42 
AnswerRe: Picturebox Control Question Pin
JUNEYT12-Mar-07 7:44
JUNEYT12-Mar-07 7:44 
GeneralRe: Picturebox Control Question Pin
JohanSturk12-Mar-07 8:31
JohanSturk12-Mar-07 8:31 
GeneralRe: Picturebox Control Question Pin
M-Hall12-Mar-07 8:50
M-Hall12-Mar-07 8:50 
GeneralRe: Picturebox Control Question [modified] Pin
JUNEYT12-Mar-07 10:08
JUNEYT12-Mar-07 10:08 
QuestionPLEASE!!!! REALLY STUCK ON THIS ONE Pin
peteyshrew12-Mar-07 4:51
peteyshrew12-Mar-07 4:51 
AnswerRe: PLEASE!!!! REALLY STUCK ON THIS ONE Pin
Christian Graus12-Mar-07 5:05
protectorChristian Graus12-Mar-07 5:05 
AnswerRe: PLEASE!!!! REALLY STUCK ON THIS ONE Pin
jhoga12-Mar-07 5:07
jhoga12-Mar-07 5:07 
QuestionUser Control Problem Pin
TCHamilton12-Mar-07 4:49
TCHamilton12-Mar-07 4:49 
AnswerRe: User Control Problem Pin
Star Vega22-Mar-07 11:09
Star Vega22-Mar-07 11:09 
QuestionChecking string value Pin
harveyhanson12-Mar-07 4:27
harveyhanson12-Mar-07 4:27 
AnswerRe: Checking string value Pin
nlarson1112-Mar-07 5:04
nlarson1112-Mar-07 5:04 

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.