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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to detect object type in OnSelectionChanged Event

Thread ID:

Created:

Updated:

Platform:

Replies:

79094 Jan 20,2009 04:57 PM UTC Jan 22,2009 03:15 PM UTC Windows Forms 2
loading
Tags: Diagram
Glenn Miller
Asked On January 20, 2009 04:57 PM UTC

In VB.net, how do I determine what Type of object is changing, and is this generalized to nodes or connectors?

A snippet in VB would be greatly appreciated.

Thanks,
Glenn


Ajeet M [Syncfusion]
Replied On January 22, 2009 01:45 PM UTC

Hi Glenn,

The code snippet is as below:

--------

AddHandler diagram1.EventSink.NodeSelected, AddressOf EventSink_NodeSelected

Private Sub EventSink_NodeSelected(ByVal evtArgs As NodeSelectedEventArgs)
Console.WriteLine(evtArgs.Node.GetType().ToString())
End Sub

--------

The "Type" for an object can be accessed using the "GetType()" method.

Let me know if this helps.

Happy Coding!
-Ajeet



Glenn Miller
Replied On January 22, 2009 03:15 PM UTC

Many Thanks Ajeet.

Just what I needed to know.

Glenn

>Hi Glenn,

The code snippet is as below:

--------

AddHandler diagram1.EventSink.NodeSelected, AddressOf EventSink_NodeSelected

Private Sub EventSink_NodeSelected(ByVal evtArgs As NodeSelectedEventArgs)
Console.WriteLine(evtArgs.Node.GetType().ToString())
End Sub

--------

The "Type" for an object can be accessed using the "GetType()" method.

Let me know if this helps.

Happy Coding!
-Ajeet





CONFIRMATION

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.

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

;