Tuto WINDEV 25

186 Part 4: Full application with data ▶ We are now going to pass the value selected in the Radio Button control in parameter to the query: 1. Display the WLanguage events associated with the Table control: • Select the Table control. • Display the popup menu (right mouse click) and select "Code". 2.  In the "Initializing" event of the Table control, replace the line: //MySource.ParamStatus = <Value of ParamStatus> with the following WLanguage code: MySource.ParamStatus = RADIO_Status In this code, RADIO_Status is the name of the Radio Button control that was just created. The value of this control is associated with the ParamStatus parameter expected by the query. 3. Close the code editor. ▶ Before running the test, we are going to create a Button control to re-display the content of Table control according to the value selected in the Radio Button control: 1. Create a Button control: • on the "Creation" pane, in the "Usual controls" group, click . • then click on the "Finding orders" pane of the Tab control, at the top right. 2. Select the control and press Enter. The control caption becomes editable. Type "Find" and press Enter on the keyboard. 3. Modify the control style: • Display the popup menu of control (right mouse click) and select "Choose a style". • In the window that is displayed, press Ctrl + F. In the search control, type "BTN_Search". • The style is automatically selected. Validate. 4. Resize the control if necessary. 5. Display the WLanguage events associated with this control: press F2. 6. Write the following WLanguage code in the "Click..." event: // Refreshes the display of Table control TableDisplay(TABLE_QRY_FindOrders, taInit) In this code, the taInit constant is used to re-run the "Initializing" event of the Table control (the event in which the parameters are passed to the query). 7. Close the code editor.

RkJQdWJsaXNoZXIy NDQ0OA==