Spread Windows Forms 6.0 Product Documentation
Put Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ActionMap Class : Put Method


key
Specified keyboard key
action
Specified action

Glossary Item Box

Creates a binding between a key and an action.

Syntax

Visual Basic (Declaration) 
Public Sub Put( _
   ByVal key As Object, _
   ByVal action As Action _
) 
Visual Basic (Usage)Copy Code
Dim instance As ActionMap
Dim key As Object
Dim action As Action
 
instance.Put(key, action)
C# 
public void Put( 
   object key,
   Action action
)

Parameters

key
Specified keyboard key
action
Specified action

Example

This example returns the keys defined in the map.
C#Copy Code
FarPoint.Win.Spread.Keystroke k = new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None);
Object obj = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused).Get(k);

int i;
FarPoint.Win.Spread.ActionMap map = fpSpread1.GetActionMap();
FarPoint.Win.Spread.Action act = map.Get(obj);
map.Put(k, act);
for (i = 0; i <= map.Keys.Length - 1; i++)
{
       listBox1.Items.Add(map.Keys(i).ToString());
}
Visual BasicCopy Code
Dim k As New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None)
Dim obj As Object = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused).Get(k)

Dim i As Integer
Dim map As FarPoint.Win.Spread.ActionMap = FpSpread1.GetActionMap()
Dim act As FarPoint.Win.Spread.Action = map.Get(obj)
map.Put(k, act)
For i = 0 To map.Keys.Length - 1
       ListBox1.Items.Add(map.Keys(i).ToString())
Next 

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.