Embeds an OI form by name so you can embed multiple forms.
Syntax
Send_Message(Ctrl, "OLE.AddNamedForm", Handle, Name, FitWidth, FitHeight)
Parameters
Parameter | Description |
---|---|
Handle | The windows handle to the form to embed. |
Name | The string that uniquely identifies this form for future reference. |
FitWidth | Flag determining whether to use the form's width or the SRP Panel's width |
FitHeight | Flag determining whether to use the form's height or the SRP Panel's height |
Remarks
The AddNamedForm method embeds an OI form inside the scrollable SRP Panel Control. Unlike the SetForm method, which only allows one form to be embedded, you can call this method over and over again to add as many forms as you want. All you have to do is include a unique name of the form so you can identify it later.
Calling this method does not show the form.
To show a form you have added, use the ActiveForm property.
The FitWidth and FitHeight parameters define the resizing behavior of the form. By default, the form's SIZE dimensions are used. So, if the form is bigger than the SRP Panel Control, then scroll bars appear which allow the user to scroll the form as desired. However, if you want the form to be autosized to fit the dimensions of the SRP Panel Control, set eiter of these flags to true. For example, if you set FitWidth to 1, then there will never be a horizontal scroll bar because the width of the form will always equal the width of the SRP Panel Control.
Example
// Add two windows to the form, then show the second one NewWindow = Start_Window("MY_FIRST_WINDOW") Handle = Get_Property(NewWindow, "HANDLE") Send_Message(@Window:".OLE_PANEL", "OLE.AddNamedForm", Handle, "FORM_A", 1, 0) NewWindow = Start_Window("MY_SECOND_WINDOW") Handle = Get_Property(NewWindow, "HANDLE") Send_Message(@Window:".OLE_PANEL", "OLE.AddNamedForm", Handle, "FORM_B", 1, 0) Set_Property(@Window:".OLE_PANEL", "OLE.ActiveForm", "FORM_B")