You can write the following code to display the time including hundredth seconds format:
txt = Format$(Time, "hh:mm:ss") & Format$(Timer - Fix(Timer), ".00")
Note: The Timer function cannot display time in hundredth-second format, it can only be accurate to 50 milliseconds.
Easy installation of registry itemsHere's a simple way to set up a registry entry when installing a program. First, manually create a project on the machine and place it under its own subpath as much as possible. Then, use the Registry Editor to output the subpath containing the project, which will create a .REG file. Finally, package this file in the installation wizard. After doing this, the installation wizard can automatically complete the creation of the registry entries when the installation is performed.
Get ASCII code quicklyDo you often need to obtain the ASCII code value of a character? Here's a simple way:
1. In the main VB programming window, select the menu "View" and then click "Immediate Window", or directly press "CTRL+G" to display the "Immediate Window" at the bottom of the screen.
2. In the immediate window, enter ?asc("b") and press Enter, you can get the ASCII code value of character b 98. For another example, if you want to get the ASCII code value of double quotes, please enter ?asc("""") and you will get 34.
Create a new project template fileWhen you select the file new project command in VB, a selection window containing multiple templates appears. Did you know? You can create a new template file very easily!
First, create a new project in the format you need. Add controls, toolbars, forms, write modules and subroutines, and do whatever you want to do when writing other project files.
Next, save the project to the project directory. I can't confirm where this project directory is located in other systems. On my system (WindowsNT/VB6), this directory is:
C:Program FilesMicrosoft Visual StudioVb98TemplateProjects
Just save it here! Give a meaningful name. Now, when you select New Project from the File menu, you will see the new template you just created.
Create help fileOften this is a very difficult topic. The help editor comes with the Visual Basic system. You can find it in the ToolsHcw or CommonToolsHcw directory of the Visual Basic CD.
First, create a theme file that contains help content. You use a mysterious set of footnotes defined by Microsoft to indicate links, topic titles, and index items. Then, save in RTF (Rich Text Format) format, which is supported by many advanced editors including Word.
Next, create a project file that defines some topic numbers and defines a help source file. Then, launch the Help Editor to create the final .HLP file.
Finally, you can use the ShowHelp method of the CommonDialog control to display the help file in your program. Here is an example program, its network path is: http://www.vb-helper.com/HowToBeg.htm. After this page appears, click the link Implement standard File and Help menu commands.
All in all, creating a help file is very difficult. The help file compiler itself is not very user-friendly and runs very slowly, especially for large help files. If an error occurs during compilation, the compiler cannot provide sufficient information. As alternative tools, many 3rd party software can do a better job.
You may also consider HTML-based help files, which Microsoft is planning to adopt in the future. However, this does not mean that traditional help is no longer useful.