We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change bitmap in node on mouse click

Thread ID:





98987 Apr 14,2011 01:37 PM UTC Mar 5,2018 04:59 AM UTC WinForms 3
Tags: Diagram
Tom Fitzmorris
Asked On April 14, 2011 01:37 PM UTC

Need to be able to change the bitmap in the selected node on mouse click to simulate an on off state.(light switch / lamp etc.)
I can trap the events. just need help for changing the bitmap if it is even possible thanks...

Pandi Murugan A [Syncfusion]
Replied On April 19, 2011 07:03 AM UTC

Hi Tom,

Thanks for using Syncfusion products.

We suggest you to set the BitmapNode's Image property to achieve your requirements. Please refer the below code snippet.

private void Form1_Load(object sender, EventArgs e)
BitmapNode bmpNode = new BitmapNode(@"..\\..\\desert.jpg");
bmpNode.Size = new SizeF(200, 100);
bmpNode.PinPoint = new PointF(300, 100);
//add event for nodeclick
diagram1.EventSink.NodeClick += new NodeMouseEventHandler(EventSink_NodeClick);

void EventSink_NodeClick(NodeMouseEventArgs evtArgs)
if (evtArgs.Node != null && evtArgs.Node is BitmapNode)
//Change the bitmap
((BitmapNode)evtArgs.Node).Image = new Bitmap(@"..\\..\\koala.jpg");

Please let me know if you have any concerns.

Pandi Murugan A

Replied On March 3, 2018 03:28 PM UTC


Naganathan Ganesh Babu [Syncfusion]
Replied On March 5, 2018 04:59 AM UTC

Hi Tom, 
Thanks for the update please let us know whether you need any further assistance  
Naganathan K G 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon