VB 2008 - Calculate values in multiple textboxes without using button click event
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: VB 2008 - Calculate values in multiple textboxes without using button click event

  1. #1
    Join Date
    Jul 2014
    Posts
    3

    VB 2008 - Calculate values in multiple textboxes without using button click event

    I would like my program to calculate values in multiple textboxes as I insert them to the textboxes(without using a button click event). As an example I have attached a simple form with 4 textboxes. The last textbox would show the result of the amounts inserted in textbox 1,2 and 3. As shown in the attached image, it would calculate the following: textbox1 -textbox2 - textbox3 = textbox4. It is simple using a button but I canīt figure out how to do it without buttons.

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: VB 2008 - Calculate values in multiple textboxes without using button click event

    you didn't include anything, but it should be simple. You don't say what you want to do, except subtract 2 tb's from the first one and put it in the 4th one.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,830

    Re: VB 2008 - Calculate values in multiple textboxes without using button click event

    You can place code in the change event of the text boxes or perhaps just the last text box, or use a timer or other depending on what you want to do.
    Also note that VB2008 is not VB6.

    I will move this to the VB.Net section where questions related to VB versions later than VB6 belong.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jul 2014
    Posts
    3

    Re: VB 2008 - Calculate values in multiple textboxes without using button click event

    Thanks for your replies. I am really new at this so Iīm not sure what to do. I will attach an image of a simple example so that you can have an idea of what I need.

    Attachment 32767

  5. #5
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: VB 2008 - Calculate values in multiple textboxes without using button click event

    not a valid link. just upload the image directly (the square w/image inside in Go Advanced)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jul 2014
    Posts
    3

    Re: VB 2008 - Calculate values in multiple textboxes without using button click event

    Name:  ex.jpg
Views: 63
Size:  40.0 KB

  7. #7
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,982

    Re: VB 2008 - Calculate values in multiple textboxes without using button click event

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center