DoModal

<< Click to Display Table of Contents >>

 

DoModal

DoModal(Screen, Title, Left, Top, Width, Height, Arg, [Flags])

Opens a modal Screen, which is a window that do not allow clicking other Screens or windows while it is not closed. The Title parameter passed in this method is only used if the Caption property is empty. Otherwise, this parameter is ignored. This method contains the following parameters:

Screen: Determines a Screen's name

Title: Determines a title for this modal window

Left, Top: XY position of this modal window, in pixels

Width: Width of this modal window, in pixels or Himetric

Height: Height of this modal window in pixels or Himetric

Arg: Determines a variable to use on Screen's OnPreShow event

Flags: Determines a combination used on this modal window. Such combination is performed by summing values of the next table that corresponds to user options. When the specified value is equal to -1 (minus one, used when this parameter is omitted), Viewer configurations are set to this modal window. When this value is different from -1 (minus one), users can use all combinations described on the next table

Possible combinations for the Flags parameter

Value

Description

1

Enables a title bar on this window

2

Enables a Close button on this window

4

Enables a Minimize button on this window

8

Enables a Maximize button on this window

16

Enables a window border

32

Specifies that this window can be resized

64

Specifies that this window can be moved

256

Specifies that this window stays on top of a Screen

512

Specifies that this window is configured with a Tool Bar style

1024

Disables object buttons

2048

Centers this modal Screen on a Frame horizontally, as well as vertically

 

The next code contains a usage example of this method.

Sub Button1_Click()
  ' When clicking the Button1 opens another modal Screen
  Application.DoModal "Screen1", "Title", 0, 0, 400, 200, 0, 3
End Sub

 

NOTE

Size values on this method can be informed as numbers or Strings. In case of numbers, they are interpreted as pixels. In case of Strings, if followed by an "hm" unit, they are interpreted as Himetric. Any other case is considered as pixels.

Was this page useful?