refresh

refresh();

The refresh method of the Window class forces a repaint of a form or control. Windows issues this paint when there are no other types of Windows messages waiting to be processed.

Use this method to force a complete repaint of a form or control when you want a form to display completely while another form is loading, or when you want to update the contents of a control.

Generally, painting a form or control is handled automatically. The paint occurs at a point when other events have completed. However, there may be situations where you want the form or control to be updated.

If the refresh method is called in the paint event of the window, it causes an exception to be raised, as this method calls the paint event again, and so on.

The method in the following example shows the use of the refresh method.

listBoxScrollBar_scrolled(scroll:    ScrollBar input;
                          scrollBar: Integer) updating;
vars
    count : Integer;
begin
    listBoxRight.clear;
    textBoxRightStart.text := theArray[listBoxScrollBar.value].Product.name;
    app.myCompany.allProducts.startKeyGeq(textBoxRightStart.text, iter);
    while count < listBoxRight.lines and iter.next(myProduct) do
        count := count + 1;
        listBoxRight.addItem(myProduct.name);
    endwhile;
epilog
    textBoxRightStart.refresh;
end;