See Also Example
Form, label, picture box , text box .
Determines the type of link used for a DDE conversation and activates the connection as follows:
Controlallows a destination control on a Visual Basic form to initiate a conversation as specified through the control's LinkTopic and LinkItem properties.
Formallows a destination application to initiate a conversation with a Visual Basic source form, as specified through the destination application's application|topic!item expression.
[form.][label.|picturebox.|textbox.]LinkMode[ = mode ]
For controls used as destinations in DDE conversations, the LinkMode property settings are:
0 (Default) None. No DDE interaction.
1 Automatic. Destination control is updated each time the linked data changes.
2 Manual. Destination control is updated only when the LinkRequest method is invoked.
3 Notify. A LinkNotify event occurs whenever the linked data changes, but the destination control is updated only when the LinkRequest method is invoked.
For forms used as sources in DDE conversations, the LinkMode property settings are:
0 (Default) None. No DDE interaction. No destination application can initiate a conversation with the source form as the topic, and no application can poke data to the form. If LinkMode is 0 (None) at design time, you cannot change it to 1 (Source) at run time.
1 Source. Allows any label, picture box, or text box on a form to supply data to any destination application that establishes a DDE conversation with the form. If such a link exists, Visual Basic automatically notifies the destination whenever the contents of a control are changed. In addition, a destination application can poke data to any label, picture box, or text box on the form. If LinkMode is 1 (Source) at design time, you can change it to 0 (None) and back at run time.
The following conditions also apply to the LinkMode property:
Setting LinkMode to a nonzero value for a destination control causes Visual Basic to attempt to initiate the conversation specified in the LinkTopic and LinkItem properties. The source updates the destination control according to the type of link specified (automatic, manual, or notify).
If a label, picture box, or text box has established an automatic link with a source application, a Change event occurs for that control each time new data is entered, whether or not the value of the data differs from the control's current contents. Note that this is the only way a Change event can occur for a label control.
If a source application terminates a conversation with a Visual Basic destination control, the value for that controls LinkMode setting changes to 0 (None).
If you leave LinkMode for a form set to the default 0 (None) at design time, you cannot change LinkMode at run time. If you want a form to act as a source, you must set LinkMode to 1 (Source) at design time. You can then change the value of LinkMode at run time.
Note Setting a permanent data link at design time with the Paste Link command from the Edit menu also sets the LinkMode, LinkTopic, and LinkItem properties. This creates a link that is saved with the form. Each time the form is loaded, Visual Basic attempts to reestablish the conversation.
Creating a DDE Source or Destination Link
Chapter 20, "Communicating with Other Applications"