I build an winforms application in c#.
I'm trying to change the default icons of MSAGL GViewer
component:
but I don't find where to do that.
How can I change them?
I build an winforms application in c#.
I'm trying to change the default icons of MSAGL GViewer
component:
but I don't find where to do that.
How can I change them?
Copyright © 2021 Jogjafile Inc.
GViewer
control uses an oldToolBar
control to show those buttons. To replace those icons, you can find the toolbar in controls collection of the viewer control and set a newImageList
containing new images for the toolbar:The image list should have 18 images in below order. When adding images to image list. After adding images, set the
Name
property of image at index 2 tozoom.bmp
because the toolbar use it's name instead of index:Using above images, and
ColorDepth
set toDepth24Bit
andTransparentColor
set toMagenta
here is the final result:Also as another option you can set
ToolBarIsVisible
property ofGViewer
component tofalse
and use your ownToolStrip
orToolBar
. Then when clicking each button, you can call corresponding method of viewer component, likeZoomInPressed
,ZoomOutPressed
,BackwardButtonPressed
,ForwardButtonPressed
, ... .Note:
For more information you can take a look at Microsoft Automatic Graph Layout source code repository and source code for
GViewer
control.