Last week of VB learning-four-digit integer Reverse Order

Source: Internet
Author: User

Four-digit integer Reverse Order:

Public class form1 private sub textbox1_keypress (byval sender as object, byval e as system. windows. forms. keypresseventargs) handles textbox1.keypress dim N, A, B, C, D, M as integer if ASC (E. keychar) = 13 then n = Val (textbox1.text) A = n mod 10' single digit B = n \ 10 mod 10' ten digits c = n \ 100 mod 10' hundred digits d = n \ 1000 m = A * 1000 + B * 100 + C * 10 + D label2.text = "the backward integer is: "& M end if end sub private sub textbox1_textchanged (byval sender as system. object, byval e as system. eventargs) handles textbox1.textchanged if not isnumeric (textbox1.text) Then msgbox ("enter a non-numeric character, please enter again", "Data check") textbox1.text = "" textbox1.focus () end if end sub private sub form1_load (byval sender as system. object, byval e as system. eventargs) handles mybase. load end subend class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.