Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Programming case of VB language

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you about VB language programming cases, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

Figure 1

1. Review the vocabulary commonly used in the control

Caption is used to describe the text content in a tag

Forecolor foreground color, such as text color

Backcolor background color, such as the background color of the tag.

Review the shape of the control

The label control uses a letter to indicate what we can identify.

Represented by an An icon.

The button icon is shaped like a small square: the button can be used as a click event, allowing us to click to produce the desired function.

Question: what are the controls that default to click events after double-clicking controls on the graphical interface by default?

Button commandbutton, text label label

Third, pop-frame learning

1 message box

Use the function msgbox, which means "message box".

Usage 1: use a parameter that is a text type (string type).

Usage: msgbox "text content".

Usage 2: use two parameters, the second parameter is the message box type selection, the second parameter can also be omitted by default, in the case of omission, there is only one confirm button, note that in the case of omission, you should also pay attention to adding commas to leave spaces.

So, what are the common types of message boxes for the second parameter?

VbCritical: it's an X symbol.

VbAbortRetryIgnore: select box to select abort, retry, ignore

VbInformation: similar to the blue exclamation point

VbOKCancel: confirm and deselect box

VbOKOnly: only the OK button

VbQuestion: question mark button

VbRetryCancel: retry and cancel button

VbYesNo: yes and no selection boxes

VbYesNoCancel: yes, no, cancel three choices

Usage 3: use three parameters, the third of which is the title title of the message box

Add: all symbols that appear when writing code must be half-width code in English state.

2 input box

Use the function inputbox, which means "input box"

Usage 1: use a parameter, which is a text type, to prompt the user what to enter.

How to use: inputbox "prompt text content"

Usage 2: the second parameter is the title title of the input box

The whole inputbox function finally returns a string (text), that is, what we enter, which can be output in a control or in a variable.

Fourth, variable supplement

Declaration format of variables:

Dim Custom variable name Type of as variable

The dim here can be translated into custom, and as can be translated into as

For example:

Dim an as string

It means to customize a variable an of type string.

The above is all the content of this article "VB language programming case". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report