C ++ Builder implements menu display of historical file list
Source: Internet
Author: User
The C ++ Builder Menu displays the list of historical files-Linux general technology-Linux programming and kernel information. For more information, see the following. This section describes how to display a list of historical files in a menu in a Windows environment and describes how to use the TRegistry Class.
Currently, many Windows applications have the following function: You can view recently accessed files under the File menu, which makes it easy for users to access files that have been accessed again. Over the past few years, this technology has become a common feature of applications with file menu items: Wps series and Office series. In the previous DOS environment, programmers generally create a file to record the file list. Is there any other method in Windows? Recently, I have successfully implemented the above functions in the registry using the TRegedit class provided by C ++ Builder5.0 C/S. The introduction is as follows:
1. Create a new project file project1 in C ++ Builder and add the following controls on Form1:
Control Name property value
TOpenDialog Name OpenDialog1
TMainMenu Name MainMneu1
At the same time, add a menu item to the MainMenu1 control, whose attribute is
Name Caption
Items1 open a file
2. In unit1.h
Private:
TRegistry * Registry;
String Items [3]; // create an array for displaying historical files //
The above programs are passed in the PWin98 and C ++ Builder5.0 environments.
In fact, many other functions of the program, such as: automatically save the program interface size, automatically remember the user password, also use
TRegedit is implemented in the registry. If you are interested, try it.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.