LinkMode Property

See AlsoMVJR5U              Example1JCYFIL>Low

Applies To

Form14TJ2LN, label3MNIZ8D, picture box31MYIWX, text boxYPYZDG.

Description

Determines the type of link used for a DDEDEFDDE conversation and activates the connection as follows:

         Controlallows a destinationHF8UZ8 control on a Visual Basic form to initiate a conversation as specified through the control's LinkTopicEVWV3S and LinkItem2NMGNS5 properties.

         Formallows a destination application to initiate a conversation with a Visual Basic sourceO9K12R form, as specified through the destination application's application|topic!item expression.

 

Usage

[form.][label.|picturebox.|textbox.]LinkMode[ = mode ]

Remarks

For controls used as destinations in DDE conversations, the LinkMode property settings are:

Setting          Description

 

  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 LinkRequest3HB029 method is invoked.

  3                 Notify.  A LinkNotify1PIR0GG 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:

Setting          Description

 

  0                 (Default) None.  No DDE interaction.  No destination application can initiate a conversation with the source form as the topic, and no application can poke1DDY1B3 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 Change8DZUNR 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.

 

Data Type

IntegerDOKXHY


See Also

Help:

Creating a DDE Source or Destination LinkJ8NEMT

LinkClose Event17O5TU0

LinkError EventEGZX07

LinkExecute Method0JJE0GF

LinkItem Property2NMGNS5

LinkNotify Event1PIR0GG

LinkOpen EventM1TL81

LinkSend MethodH24SKI

LinkTimeout Property3OGSG5

LinkTopic PropertyEVWV3S

Using DDEHOWDDE

 

Programmer's Guide:

Chapter 20, "Communicating with Other Applications"