The new night has started again, I have to continue my chat. Nowadays are really tired, go to work, go home to cook, maybe I have to go out with my friends at night, there is no way, I can't do it, so I am scared that I am married. I don't dare to knot: P: p These can don't let My girlfriend saw that it was finished :)
Items is not just the unique properties of the class components, and she may also be attributes of several components such as Listbox, Checklistbox, TreeView, or ListView, and cannot be the properties of the text properties component, and in the text attribute is Lines. Lines I will say later. To put it bluntly, if you use it if it is not a data stream, then it should be items: P
Place a listbox component or checklistbox component in a new form, we click on "..." on the right side of the items attribute to initialize their options, you will find that they are the same, there is no line number in the editor, yesterday I said yesterday If you have, you may not forget it right away, there is no line number, that is, it is impossible to use items [] to access the contents of each line, but you can use the ADD to dynamically call them, like this section like you. It should be understood :)
Void _fastcall tform1 :: button1click (TOBJECT * Sender)
{
IF (Edit-> Text! = "")
{
Listbox1-> items-> add (edit1-> text);
......
}
It also has ItemsIndex in both components, which seems to be similar to the components in RadioGroup, and the fact is like this: P
There is also an items attribute in TreeView and Listviex, let's take a look at how they work.
In TreeView, we can build and access each node via items. We only need to click on "..." or double-click the TreeView component on the list of items attributes, you can enter the list view editor, and we use the "New Item" button to create a parallel node in this editor. After selecting a node, click the "New SubItem" button to create the child node of this node. The "Delete" button is used to select a node, if this node has a child node, will be deleted at the same time. The LOAD button is used to read a tree view from the file. On the right text attribute used to specify the title of the selected node. Image Index property is used to specify the icon on the left side of the node in the sequence number in the list view. The SELECT INDEX property item is used to specify the icon displayed when the node is selected in the sequence number in the list view. The State INDEX property is used to specify the serial number indicating the icon of the node status in the image list.
In ListView, we click "..." on the right side of the items property, you will pop up a list view editor, which is similar to TreeView, naturally their usage is almost, but in them use items [int i] -> text statement Never right. Because we didn't see there in the editor, right: P
Of course, we can also edit them, how to edit it? We should see editing her method in the editor. This is why I want to see the editor status :)
We must use the following block: void _fastcall tform1 :: btninsertclick (TOBJECT * SENDER)
{
TListItem * Temp; // Defines the items type in a listview, here she is a TLISTITEM class
Temp = listview1-> items-> add (); // give a value, here to increase, so select the add () function, haha, you said that it is now the program wants to call the listview items editor editor new itemtemp-> CAPTION = Edit1-> text; // Dynamically create a node, that is, you add a node, then the title of this node must of course be written in the caption, this capen you can see it in the editor :)
Temp-> Subitems-> add (edit2-> text); // Dynamically create a child node, actually calling new subItem, Subitems appears on the left side of the editor
... // Continue to create a child node
}
Of course, there is a viewstyle attribute in ListView, if you don't change her into vsreport, then you will not show your content in your ViewStyle, and this column has a line number, she Can you create it dynamically? (From our above analysis, you can't get conclusions)
The same Items, why there is a different usage, mainly because they are not a direct object of TStrings, and the two of today belong to two different objects of Treenodest and ListItems, but causing a variety of different ways of use. The root cause is completely caused by virtual functions, we can use such means to enrich our programs in our program.
Write here Items is finished, I declare what technical articles are to write here, just talk to everyone, professional articles you can read books, don't look at my article, I should write yesterday. Ok, but I saw everyone's comments, I didn't sleep well overnight. Maybe everyone's writing style is different. The purpose of my writing is just to let friends who have not entering the BCB can get started quickly. Technology, only some ways to get started (or self-study).
I have learned BCB time, I started learning C from the twice, until today, I love C, in the DOS system, use TC to write music, graphics, and micro-programs like mine, happy But use C to write an app is some unlike, it is easy to use FoxBase to write, I think the most representative of my FoxBase is a set of student results processing software, but his original code is 50 Multiple Pages. After the work, I found that DOS didn't use it. It became WIN. I found that WIN is convenient (it is not convenient, I have to learn, because no one uses DOS), no way, my original procedure is not used, like it The software, the program that does not turn into win, I was first changed from Excel, learn how WIN is programmed, I didn't go to learn VFP, and I chose my favorite C, VC and BCB I thought. For a long time, I finally chose the BCB of TC a development company. Maybe this is a mistake. I bought some professional books, I have seen it for a long time, I didn't understand it, I've been a friend's guidance to let me re-re- Start aware of the BCB. Today, some programs may be made with BCB. It is a bit self-sufficient, but I am chaotic here, but I really don't want to lose what BCB's face, I just want to say BCB is not necessarily from professionalism. At the beginning of a very strong book, it is important that you have to learn to use, because we don't necessarily want to be a theoretical master, but just want to be a programmer! How do I understand what the bitter statement? There is no major book, where did you go? You wrote me! I can't write, you can write, like why I have such an idea in the early 1970s, are you clear? I don't know if I published in "Banyan" (http://www.rongshuxia.com:8033/VIEWART.RS ?AID=1423668) You talk: p Have something to say that men do not cry, But I wrote these things, I don't give me money, why should I write? As for why it is placed on top, I want to edit her still a bit, I am really strong to write this article, the original plan is going to write for a long time, now I can only write this, wait until there is a mood. As for "elegant BDE", I will finish it as soon as possible, the original plan to write "deep-in-depth QR" is more excessive article, I don't prepare it here, I am afraid that you have such a master: P
Why do you still write today, because I can not write tomorrow, but I can't finish it, it is a bit too sorry :(
Fortunately, my article is not copying, writing is completely my feelings. But I don't understand, I also wrote a strong professional article like "Pile in VCL", "Easily use ActiveX in BCB" but why no one said three to four? I really don't understand?
I finally ended, I couldn't write, master you closed, I don't write it?
Finally, thank you for your love for my article!
I would like to thank those friends who are jealous, I'm writing, you will write, I will not be a little installed, I should be :(