tailieunhanh - Visual C++ and MFC Fundamentals programming phần 8

Một loại nhãn, bạn có thể thêm một hình thức hoặc consis hộp thoại ts cách nhấn vào nút Static Text từ thanh công cụ điều khiển và nhấp chuột trên máy chủ. Việc kiểm soát Static Text là dựa trên lớp CStatic. Một người sử dụng có thể không trực tiếp thay đổi bất kỳ khía cạnh của nhãn. Vì lý do này, bạn sẽ thường không được quan tâm với IDentifier của nhãn. | Chapter 16 Text -Based Controls Visual C and MFC Fundamentals 3. Return to MSVC Static Labels Another type of label you can add to a form or dialog box consis ts of clicking the Static Text button from the Controls toolbar and clicking on the host. The Static Text control is based on the CStatic class. A user cannot directly change any aspect of a label. For this reason you will usually not be concerned with a label s IDentifier. In fact as we will see in this lesson all controls that are static type have an identifier called IDC_STATIC. If for any reason you want to refer to a label in your code you must first change its identifier from IDC_STATIC to something else. As stated already the most important aspect of a label is the text it displays. This is the Caption property. If the label is used to identify another control you can help the user access that control using an indicator called an access key. An access key is a underlined letter on the label so that when clicked it gives access to the accompanying control. To create an access key choose a letter on the label and precede it with the ampersand character . Form example L etter would produce Letter. When there are many access keys on a form or dialog box you should make sure that no two access keys are the same. That is you should not use the same letter on various labels although this is allowed. Because you can forget to follow this rule after creating the access keys you can ask Visual Studio to check for access key duplicates. To do this right-click the form or dialog box and click Check Mnemonics 496 FunctionX Inc. Visual C and MFC Fundamentals Chapter 17 Track-Based Controls If there are duplicate access keys you would receive a message accordingly If you possible you should correct by changing one of the access keys without using one that exists already. To use the access keys the user presses Alt and the letter that corresponds to the access key. The text of the caption follows a line .

TỪ KHÓA LIÊN QUAN