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

How to realize automatic typing effect in VB language

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

Share

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

Editor to share with you how the VB language to achieve automatic typing effect, 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 know it!

Knowledge case objectives in this section

1. The main knowledge points used in this section:

String segmentation function left

Global variable

Clock control timer

Label control label

II. Introduction to the development process

Interface design

You need to use label controls, Image controls, and timer controls. Set the stretch property of the image control to true, which means that the picture can scale freely.

two。 Function development

The core function here is the left function. Here we introduce the main points of the left function.

The main function of the left function is string segmentation.

The format of the left function:

Left (string, number of strings)

Introduction to related knowledge:

Double quotation marks to indicate a string

Variable: variable quantity.

Variables are actually declared to occupy a certain amount of space in memory space.

Dim s as String

Ningbo Vocational Education Center School is a world-class vocational high school. "

Comment code uses single quotation marks.

The commented code is not run by the program, and usually the commented code only needs to be used as an explanatory explanation.

Cls command

Cls means to clear the content output by print on the form form.

The type of variable involved in the case:

1. Integer variable integer

The values in the type of this variable are all integers.

Numerical types are usually used to compare sizes and to run mathematically.

two。 String type (text type) String

The text type is indicated in "" double quotation marks.

Text types can concatenate multiple strings with the symbols & and;.

Initialization of related variables

The Form_Load event occurs when the form starts.

Represents the code to run when the form starts.

Initialization code, we need to print the string to write the global variable s, the number of words printed to the global variable a.

Knowledge interface design in this section

Timer control property configuration

The knowledge source code of this section:

Dim s As StringDim an As Integer

Private Sub Form_Load () s = "Ningbo Vocational Education Center School is a world-class vocational high school." A = 1Label1.ForeColor = vbRed

End Sub

Private Sub Timer1_Timer () 'ClsLabel1.Caption = Left (s, a) a = a + 1

End Sub

The above is all the content of the article "how to achieve automatic typing effect in VB language". 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