Powerbuilder 8.0 CHECKBOX Usage Method.

zhaozj2021-02-16  51

First see the code:

Role: Which Item is tested by Check.

Description: Create a form first, add 1 ListView control that is LV_Action, a CommandButton control. The following code is then added to the Clicked event in CommandButton (Fig. 1, 2). Specifically, in the code.

/ / -------------------------------------------------------------------------------------------- ------------------------------------------------

ListViewItem lvitem; // Item object, save the ListView's Item type object.

Integer i; // cycle variable.

Integer n; // iTEM number.

String str; // result.

n = lv_action.totalitems (); // Gets the number of items for ListView.

IF (n> 0). // If there is an item. FOR i = 1 to n // loop. IRET = lv_action.getitem (i, lvitem); // Gets the ListView's Item object, which contains the check-related property. IF (IRet = 1) Then // If successful. Str = string (lvitem.StatePictureIndex); // Gets the picture index value of Check, 1 indicates unchecked. > 1 Represents the INDEX value corresponding to statePicture. This property is also checked. Str = "|"; // Add separation, make the result easy viewing. End if next end ifmessagebox ("", str); // Display result (which Item is checked by Check, "is check).

/ / -------------------------------------------------------------------------------------------- ------------------------------------------------

Significance: You can use ListBox to graphically or radio (need to be controlled). This way the user interface is relatively intuitive.

Disadvantages: It may be more difficult to control. But for iTEM less applications or a good choice.

Drawings:

(1) Listbox (Note whether the checkview of ListView is selected. Order: From the top downward from left to right):

(2) Use the corresponding results displayed by MessageBox:

Because you don't understand your E article, it may not be possible to understand the help file of PowerBuilder.

It is too thorough. This article is also a problem that is encountered in the process of using PowerBuilder 8.0.

to sum up.

转载请注明原文地址:https://www.9cbs.com/read-22191.html

New Post(0)