How to make a NeoPlanet-like interface
Since the birth of the electronic diary, the author has received many letters, and quite a few of them are curious about the software interface and asking the author how to create such an interface effect. The production method is now integrated into a demonstration program of an active program to answer all friends in a unified manner. In fact, it is not difficult to make this kind of NeoPlanet-like interface effect. Friends who know a little bit about C++Builder will find the truth obvious just by looking at the demonstration program. Below is a brief introduction to the technical points inside.
● Overall concept:
When we usually write programs, we usually inherit from the TForm class when creating a new form. TForm is the default form base class in VCL, so the form inherited from TForm can only maintain the Windows standard interface style. But if you do not inherit directly from the TForm class, but write a form class yourself (such as TNeoForm), this class takes over the messages of most form operations (such as changing size, maximizing and minimizing, etc.), and modifies the inherent standard interface of Windows. , and then when you create a new form, it will all inherit from TNeoForm, so that all the forms in your application have the style and characteristics of TNeoForm, and the purpose is achieved.
● Design of TNeoForm:
The complete source program of TNeoForm is included in the demonstration program. It is not very long, only 560 lines. You can understand it after careful study. It is necessary to point out that TNeoForm is not perfect yet, and there are many areas that need improvement. If any friend is interested in making it better, I hope you can send a copy to the original author (Email:
[email protected]).
● Things to note:
1. TNeoForm currently cannot handle menu hotkeys (such as Alt+X, etc.). The only way is to set the KeyPreview of the new form to true, and then use a program to handle the menu hotkeys in the KeyDown event of the form.
2. To set whether the form can be resized by the user, you must assign a value to Sizeable in the form's constructor or FormCreate event.
3. To set whether the form has a maximize button or minimize button, you can directly set the BorderIcons property of the form in the Object Explorer (Object Inspector) in C++Builder.
Author: Hao Xingeng
1999/10/15