OnControlLostFocus
IPDFDocument4 :: Annotations

See Also Example
Collapse All

This property gets or sets an action to be performed when the PDF control loses the input focus.

Syntax

LONG OnControlLostFocus { get; set; }
Value
Number of the action

Remarks

The number of the action can be retrieved from any action-creating method, such as CreateJavaScriptAction.

Example

Handling OnAnnotLostFocus and OnAnnotSetFocus

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
a1 := PDF.CreateJavascriptAction('app.alert("Focus set.")');
a2 := PDF.CreateJavascriptAction('app.alert("Focus lost.")');
PDF.AddEditBox(10, 10, 60, 24, 'edit1');
PDF.AnnotUnicodeText := 'Edit1';
PDF.AddEditBox(70, 10, 120, 24, 'edit2');
PDF.AnnotUnicodeText := 'Edit2';
PDF.OnControlSetFocus := a1;
PDF.OnControlLostFocus := a2;
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
long a1 = PDF->CreateJavascriptAction("app.alert('Focus set.')");
long a2 = PDF->CreateJavascriptAction("app.alert('Focus lost.')");
PDF->AddEditBox(10, 10, 60, 24, "edit1");
PDF->AnnotUnicodeText = L"Edit1";
PDF->AddEditBox(70, 10, 120, 24, "edit2");
PDF->AnnotUnicodeText = L"Edit2";
PDF->OnControlSetFocus = a1;
PDF->OnControlLostFocus = a2;
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
long a1 = PDF.CreateJavascriptAction("app.alert('Focus set.')");
long a2 = PDF.CreateJavascriptAction("app.alert('Focus lost.')");
PDF.AddEditBox(10, 10, 60, 24, "edit1");
PDF.AnnotUnicodeText = "Edit1";
PDF.AddEditBox(70, 10, 120, 24, "edit2");
PDF.AnnotUnicodeText = "Edit2";
PDF.OnControlSetFocus = a1;
PDF.OnControlLostFocus = a2;
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
a1 = PDF.CreateJavascriptAction("app.alert('Focus set.')")
a2 = PDF.CreateJavascriptAction("app.alert('Focus lost.')")
PDF.AddEditBox 10, 10, 60, 24, "edit1"
PDF.AnnotUnicodeText = "Edit1"
PDF.AddEditBox 70, 10, 120, 24, "edit2"
PDF.AnnotUnicodeText = "Edit2"
PDF.OnControlSetFocus = a1
PDF.OnControlLostFocus = a2
PDF.SaveToFile "test.pdf", true

See Also

Reference