SetItemMenuCaption Method (GdViewer)
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 GdViewer.EnableMenu property.
public void SetItemMenuCaption(
int ,
string
)
public procedure SetItemMenuCaption(
: Integer;
: String
);
public function SetItemMenuCaption(
: int,
: String
);
public: void SetItemMenuCaption(
int ,
string*
)
public:
void SetItemMenuCaption(
int ,
String^
)
'Declaration
Public Sub SetItemMenuCaption( _
ByVal As Integer, _
ByVal As String _
)
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):
- Pages / Frames
- Pages / Frames -> Goto First
- Pages / Frames -> Goto Previous
- Pages / Frames -> Goto Next
- Pages / Frames -> Goto Last
- Play Gif
- Stop Gif Animation
- Rotations - Flips
- Rotations - Flips -> Rotate 90°
- Rotations - Flips -> Rotate 180°
- Rotations - Flips -> Rotate 270°
- Rotations - Flips -> Flip X
- Rotations - Flips -> RotateFlip 90°
- Rotations - Flips -> RotateFlip 180°
- Rotations - Flips -> RotateFlip 270°
- ScrollBars
- Copy Bitmap to Clipboard
- Zoom
- Zoom -> Zoom in
- Zoom -> Zoom out
- Zoom -> Zoom 100%
- Zoom -> Zoom to selected area
- Zoom -> Fit image to viewer (keep aspect ratio)
- Zoom -> Fit image to viewer (don't keep aspect ratio)
- Zoom -> Fit image to viewer width
- Zoom -> Fit image to viewer height
- Mouse Mode
- Mouse Mode -> Nothing
- Mouse Mode -> Hand Pan Tool
- Mouse Mode -> Area Selection Tool
- Left Click -> Area Zooming Tool
- Viewer Quality
- Viewer Quality -> Automatic
- Viewer Quality -> Quality Low
- Viewer Quality -> Quality Bilinear
- Viewer Quality -> Quality Bicubic
- Viewer Quality -> Quality Bilinear HQ
- Viewer Quality -> Quality Bicubic HQ
- Mouse Mode -> Magnifier Tool
- Copy Text to Clipboard
- Shrink image to viewer width
- NewMenuCaption
- The new caption for the specified menu item.
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")
GdViewer1.SetItemMenuEnabled(1, False)
GdViewer1.SetItemMenuEnabled(8, False)
GdViewer1.SetItemMenuEnabled(16, False)
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");
GdViewer1.SetItemMenuEnabled(1, false);
GdViewer1.SetItemMenuEnabled(8, false);
GdViewer1.SetItemMenuEnabled(16, false);
}
else
{
GdViewer1.RemoveItemMenu(6);
GdViewer1.RemoveItemMenu(7);
}
}
else
MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.SetItemMenuCaption");