In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the example analysis of the core programs in the VB language. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
The core program is shown in figure 1
Figure 1
Shortcut keys
The VB code prompts for the shortcut key ctrl+j
II. Label
Label text label, text content in Caption
III. Symbolic meaning
The equal sign = has two meanings:
1. Assign a value. It's the setting.
two。 Judge. Used for logical judgment of if statements.
4. Data type
The common data types in VB are as follows:
1. String type: text type. Similar to text, indicated by double quotes "". For example, use double quotation marks to indicate a number, such as "666", which is also a text type.
Examples of text types are:
1) content of caption
2) content of text
3) the content of name
two。 The numerical types are:
1) Integer: integer type. Including positive integers, zero, and negative integers.
2) floating point type: mostly real numbers. Including integers and decimals.
V. events
1) Click event: click.
What does the event of a control consist of?
The format consisting of the control name _ event name.
Example button click event: button name _ click
For example, double-click event of text label label: tag name _ DblClick
Question: where to choose the name of the event?
In the upper-right corner of the code form. You can see the code form by right-clicking "View Code" on the interface form.
It has been proved that not all controls have the same events.
Question: what should I do if I can't find the form, the property, the toolbar and so on in the VB software?
Go to the menu bar of the software to find the "View", from which you can find the desired form. All the controls are in the toolbox in the view.
6. Code encapsulation there are two common ways to encapsulate code in VB:
Code is case-insensitive in VB.
1. The process of the event. That is, sub, becomes a process. It becomes a process from the beginning of the Sub line to the end of the End Sub line. Each event corresponds to a process. We can also customize the sub process.
two。 Function. Also known as function. Start function, start, and end end function.
Code debugging
Invincible software program code debugging skills:
1. Put a red dot on the left side of the first line of code or the code you want the program to stop.
two。 Start click to start the program
3. If the red dot is in the click event, then we need to click on the appropriate place to enter the program and go to where you want to stop the program.
4. This time code will stop where you put the red dot, press F8, and the program will execute the current line of code marked in yellow.
5. By pressing F8 step by step, you can clearly see the whole process of running the program.
The case interface of this question is shown below:
source code
Private Sub Command1_Click () Label1.Caption = "football"
'start calling the custom procedure Call aaa
End Sub
'custom procedure Sub aaa () MsgBox "I am Lao Liu" End Sub
Private Sub Label1_DblClick () Label1.Caption = "I also like singing" End Sub
This is the end of this article on "sample Analysis of Core programs in VB language". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.