CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Textbox values

  1. #1
    Join Date
    Mar 1999
    Posts
    8

    Textbox values



    I have the situation where on checking a checkbox focus is sent to a textbox and if the value of the textbox is not greater than zero ie if uninitialized or zero or empty then the user may not proceed until a valid value is placed in the textbox. Can anyone help!

  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Textbox values



    Hi


    This isn't exactly standard windows behavior and would involve some 'slimy hacks' to get it working the way you want.


    Wouldn't it be better to disable the other controls until a value is entered into the Text Box (you could check the value in the _KeyUp event,


    eg.


    If Len(Text1.Text) = 0 Then ... nothings in the textbox


    or


    Dim lVal As Long


    On Error Resume Next


    lVal = CLng(Text1.Text)

    If lVal = 0 Then ..... error


    etc).


    Regards


    Chris Eastwood

    CodeGuru - the website for developers

    http://www.codeguru.com/vb




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured