GdPicture.NET Reference Guide
SetItemMenuCaption Method (GdViewer)
Example 





GdPicture14.WPF Namespace > GdViewer Class : SetItemMenuCaption Method
The new caption for the specified menu item.
Changes the caption of the specified contextual menu item. The available menu items are listed below.

The context menu is only available if some document is displayed in the GdViewer control. Please note that the toolkit does not support adding custom menu items right now.

You can control displaying the menu in the GdViewer control by using the EnableMenu property.

Syntax
'Declaration
 
Public Sub SetItemMenuCaption( _
   ByVal MenuItemIdx As Integer, _
   ByVal NewMenuCaption As String _
) 
public void SetItemMenuCaption( 
   int MenuItemIdx,
   string NewMenuCaption
)
public procedure SetItemMenuCaption( 
    MenuItemIdx: Integer;
    NewMenuCaption: String
); 
public function SetItemMenuCaption( 
   MenuItemIdx : int,
   NewMenuCaption : String
);
public: void SetItemMenuCaption( 
   int MenuItemIdx,
   string* NewMenuCaption
) 
public:
void SetItemMenuCaption( 
   int MenuItemIdx,
   String^ NewMenuCaption
) 

Parameters

MenuItemIdx
The index of the menu item to change its caption. The available values representing individual menu items are listed below (please see the corresponding ordering number for each menu item):

1: Pages / Frames

2: Pages / Frames || Goto First

3: Pages / Frames || Goto Previous

4: Pages / Frames || Goto Next

5: Pages / Frames || Goto Last

100: Play Gif

200: Stop Gif Animation

300: Rotations

310: Rotation || Rotate Page 90°

311: Rotation || Rotate Page 180°

312: Rotation || Rotate Page 270°

313: Rotation || Flip Page Horizontally

314: Rotation || Flip Page Vertically

315: Rotation || Rotate View 90°

316: Rotation || Rotate View 180°

317: Rotation || Rotate View 270°

318: Rotation || Flip View Horizontally

319: Rotation || Flip View Vertically

400: ScrollBars

500: Copy Bitmap to Clipboard

501: Copy Text to Clipboard

600: Zoom

601: Zoom || Zoom in

602: Zoom || Zoom out

603: Zoom || Zoom 100%

604: Zoom || Zoom to selected area

605: Zoom || Fit image to viewer (keep aspect ratio)

606: Zoom || Fit image to viewer width

607: Zoom || Fit image to viewer height

608: Zoom || Shrink image to viewer width

700: Mouse Mode

701: Mouse Mode || Nothing

702: Mouse Mode || Hand Pan Tool

703: Mouse Mode || Area Selection Tool

704: Mouse Mode || Area Zooming Tool

705: Mouse Mode || Magnifier Tool

800: ViewerQuality

801: ViewerQuality || Low

802: ViewerQuality || Medium

803: ViewerQuality || High

NewMenuCaption
The new caption for the specified menu item.
Remarks
Please note that the context menu is only available if some document is displayed in the GdViewer control. Changing menu items properties is possible without any limitations.

Be aware that the toolkit does not support adding custom menu items.

Example
How to change the caption for contextual menu items.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    If GdViewer1.GetLastPath().EndsWith(".gif") Then
        GdViewer1.SetItemMenuCaption(6, "PLAY GIF ANIMATION")
        GdViewer1.SetItemMenuCaption(7, "STOP GIF ANIMATION")
    Else
        GdViewer1.RemoveItemMenu(6)
        GdViewer1.RemoveItemMenu(7)
    End If
Else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetItemMenuCaption")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    if (GdViewer1.GetLastPath().EndsWith(".gif"))
    {
        GdViewer1.SetItemMenuCaption(6, "PLAY GIF ANIMATION");
        GdViewer1.SetItemMenuCaption(7, "STOP GIF ANIMATION");
    }
    else
    {
        GdViewer1.RemoveItemMenu(6);
        GdViewer1.RemoveItemMenu(7);
    }
}
else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetItemMenuCaption");
See Also

Reference

GdViewer Class
GdViewer Members
RemoveItemMenu Method
EnableMenu Property