Visual Basic Skills

zhaozj2021-02-11  217

◤ Category Abstract Back Home ◎

Visual Basic Use Skills 1 Prevent Procedures Repeated Run if you don't want your VB application to be repeated by others, resulting in insufficient memory or other accidents, you can add the following lines in the program: Private Sub The form_ loadif appprevinstance ThenmSgbox program is running, please check if the window is minimized. "End ifnd Sub2 保 UCase function to ensure the correctness of the file operation Under Win32 platform, the file name is generally lowercase letters, but in the Win95 platform, sometimes Updaptish. In order to ensure that programs involving file operations developed in Win32 platforms can also work normally in Win95 platforms, and can be used to convert file names with UCase functions. For example, in the Win32 platform, use VB3 to develop a media browser, you can use the following block to implement automatic playback, regardless of the "AVI", "WAV", "MID", or lowercase, or lowercase , "WAV", "MID", or case: SUB File1_Click () mmControl1FileName = file1path & "/" & file1FileNamet = UCase (Right (file1FileName, 3)) if t = "avi" OR T = "WAV" OR T = "MID" the nmmcontrol1command = "close" mmControl1command = "play" end ifnd Sub3 in VB5 Chinese characters in length 1 rather than 2 in VB3, each Chinese character is 2, while each of the Chinese characters in VB4 and VB5 is 1. It takes special attention when intercepting the substrings of the Chinese character string, which brings great convenience to the sorting, retrieval and screening procedures for designing Chinese characters. In addition, the ASCII code of Chinese characters in VB5 is less than 0, and in VB3 or C , the ASCII code of Chinese characters is greater than zero.

转载请注明原文地址:https://www.9cbs.com/read-3978.html

New Post(0)