VB how to do the number press button, in VB, enter the number through the command button

Updated on technology 2024-02-08
15 answers
  1. Anonymous users2024-02-05

    It's similar to a calculator.,Numbers can be entered on the interface.,You can also use the keyboard to enter.,Later dedicated**!!

    That's part of a calculator design.

    First, create a control with name, caption 0, and index 0 on the form, and create a text1 control, and the text property of text1 is empty.

    Then, paste the following **:

    private sub form load() to create an array of widgets.

    dim i%, numwidth%

    numwidth = number(0).width

    for i = 1 to 9

    load number(i)

    if i mod 3 = 1 then

    number(i).top = number(i - 1).top - number(i - 1).height - 100

    number(i).left = number(0).left

    elsenumber(i).top = number(i - 1).top

    number(i).left = number(i - 1).left + number(i - 1).width + 100

    end if

    number(i).caption = i

    number(i).visible = -1

    next i

    number(0).width = number(1).width * 3 + 100

    end sub

    private sub number click(index as integer) 'Displays numbers in text1.

    text1 = text1 & number(index).caption

    end sub

    Note: You can also move the cursor directly to text1 and enter the numbers directly from the keyboard.

  2. Anonymous users2024-02-04

    Add a "button".

    Double-click that button, write **, and you're done.

    If you don't understand and ask me again, good luck, o( ohehe

  3. Anonymous users2024-02-03

    "1""2"

    private sub command1_click()= & "1"

    end sub

    private sub command2_click()= & "2"

    end sub

    private sub command3_click()= & "3"

    end sub

    private sub command10_click()= & "0"

    end sub

    The keyboard only needs to put text1 into the focus and type.

  4. Anonymous users2024-02-02

    Press the C key, 1, len (

    Press"0"Pick up the initialization command.

    Re-enter? You press ce, all variables, constants are initialized.

  5. Anonymous users2024-02-01

    It can be to add du to the end of the bai text box

    Add a number, that is, add the special number displayed by the command button dao after the content of the text box.

    For example, private sub command3 click() = &"3"

    end sub

    or a generic button group.

    private sub command1_click(index as integer)

    index

    end sub.

  6. Anonymous users2024-01-31

    This is easy, and the first command button is written like this.

    The second command reads like this.

  7. Anonymous users2024-01-30

    To give you an idea, use buttons and text boxes to implement it. Each button corresponds to a number or symbol. Press the button to display the corresponding number in the text box. A simple **.

    private sub command1_click()= "1"

    end sub

    It's that simple.

  8. Anonymous users2024-01-29

    Haven't used barcode equipment before?

    The barcode scanner is a keyboard that is plugged into the keyboard mouth, understand?

    The barcode printer is a printer, but I have only seen the use of DOS, I have not used it under Windows, it is said that it is to print a string of numbers.

  9. Anonymous users2024-01-28

    Is it only in the input socket?

  10. Anonymous users2024-01-27

    That is to say, the up key is multiplied by ten once, and the key pressed is divided by ten (the two ends are not considered first), if this can judge the key value of the key, when the upper key is to multiply the content of the text box by ten, press and divide by ten, and then display and then process it, but why not use the list box?

  11. Anonymous users2024-01-26

    Please describe your problem carefully, (with appropriate punctuation, it won't kill anyone).

  12. Anonymous users2024-01-25

    To see if that's the case, create a new project, add a textbox, a button, and write = in the button's click event

  13. Anonymous users2024-01-24

    If you have one, you can use it

    Multiple arrays of on-demand controls:

    command1(index).caption

  14. Anonymous users2024-01-23

    The buttons from 0 to 9 are titled 0 to 9 and then the click event for each button

  15. Anonymous users2024-01-22

    Set the text box text1 and the button command1, ** as follows:

    private sub text1_change()if isnumeric(text1) = false then'If it is not a number, the command1 button is invalid.

    falseelse, if it's a number, the command1 button works.

    trueend if

    end sub

Related questions
6 answers2024-02-08

1.Wash the osmanthus, drain the water, remove 10g of salt from 200g of osmanthus, and smoke barrier. >>>More

13 answers2024-02-08

Calmly, the third year of high school can generally increase the score by about 100. >>>More

22 answers2024-02-08

Brine-cured eggs:

First boil 5 kg of water, pour in 1 kg of salt, stir well, dissolve all the salt, and wait for the brine to cool and set aside. Then put 100 fresh eggs cleaned with a cloth into a jar or jar, the eggs should be flattened, pressed with bamboo or wood chips, and then poured in salt water. The salt water should be 10 cm higher than the egg surface, and the mouth of the tank should be tightly sealed. >>>More

11 answers2024-02-08

Stir-fry the bean paste until fragrant, add water, put hot pot meatballs, bean skin and other vegetarian dishes you like, and stew in one pot.

14 answers2024-02-08

The first is to wash the fat intestines, and I learned a trick from my mother, that is, after washing the fat intestines first, of course, turn the inside out, pour an appropriate amount of vegetable oil, and rub it for a while, and wash out those slippery things, wash them with clean water, then boil the water, put the washed intestines inside, boil for about five minutes, scoop up the bubble in cold water, and then clean it again, cut it into sections for later use. >>>More