Add a "Yishen" dialog box to the application

zhaozj2021-02-11  228

At present, almost all business software will display a "Yue Moon Tour" dialog in the startup, which generally displays a skill about the software, and users can browse all of them one by one. Below is a method for implementing this feature with Visual Basic 5.0: The key is that there are three problems to resolve: First, how to save information in terms of skill information; the other is how to read it. Solve the first question, there are two kinds of ideas: First, save the skill information in a text file, save a skill, then use the VB's file read and write command to read; another solution is to bring the VB ACCESS database, save the skill information in a table of the database, then read information from it. This paper uses the second method to save skill information. The second problem is relatively easy to resolve, we can generate random numbers through the random number of VBs as the skill number to read, and then locate the move method of the database object to this skill, and display it with the field property. There are two ways to solve the last problem: First, use a separate file to save a tag, first check the tag each time, then determine if the "yeli moon tired" dialog is displayed according to the value of the tag; another idea is more Skillability, we can use the Win95 system registry, create an application project in the registry, save whether the displayed tag is saved, first check the tag each time, when the user clicks the "Check the box button", Simply modify the value of this tag, and all of these operations can be implemented simply through several commands in the system registry in VB. This paper uses a second method to achieve, you can access the system registry with VB in the way by passing the VB. 1. Establish a form to add a standard form in the application's project, place a PictureBox, a checkbox, two label, and three CommandButton, which are shown in the following table. 2. Establish a skill database to generate a "Visual Data Manager" named "MyMDB" with VB (if the application itself has a ready-made database, you can use it directly, the name does not need to change), in the database Newly built a table named "TIPS", which only contains a variable length text type field, the field name is TIP, the length can be determined according to the specific situation, and set to 50. After the table is built, enter several records in it (there is a tips.txt in the win95 directory, where there are many skill information, you can choose some, add some other ways related to the application to form your own skill database. ). The specific code is slightly. 3. Some descriptions (1) GetSetting and Savesetting Usage These two commands (functions) are critical commands of VB and system registry interact, where getSetting returns the registry key settings from the registry app item, Savesetting The application project or save the settings in the registry, which looks for the online help of VB. (2) If the information in the registry should be deleted when the application is uninstalling the application, the "Yue Yue" dialog is added to the registry, and therefore, it should be polite to delete this information when uninstalling the application, and the method of deleting the way is to use Another command of the registry deletesetting on the registry. (3) In the application menu, you can access the "Yue Moon" dialog box except that the "Yue Moon" dialog box is displayed when the application starts, it should also be allowed to activate the dialog box through the menu, the method is really simple, just need Add a "accumulation" to the menu to open the FRMTIP form.

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

New Post(0)