appletonrd Posted January 7, 2006 Posted January 7, 2006 Hi ppl, I'm trying to create an event on a derived class, based on Microsoft.Web.UI.WebControls.TreeNode; This object does not have any mouse movement related events, but I'd like to display a certain tooltip when the mouse hovers each element of this type. I've done a few things, but I can't get it to catch the mouse over event. I am missing something, but what? Webforms don't have mouse movement events either... Thanks in advance Here's the relevant portion of the code I have: On the derived class: namespace TestProj { public delegate void OnMouseOverEventHandler(object source, System.EventArgs e); ... public class TNode : Microsoft.Web.UI.WebControls.TreeNode { public event OnMouseOverEventHandler OnMouseOver; ... public TNode() : base() { this.OnMouseOver += new OnMouseOverEventHandler(this.MouseOverInterpret); } public void MouseOver(EventArgs e) { if ( OnMouseOver != null ) { OnMouseOver(this, e); } } private void MouseOverInterpret(object sender, EventArgs e) { MouseOver(e); } -------------------------------------- on the webform: ... private void Page_Load(object sender, System.EventArgs e) { TNode lNode = new TNode(); lNode.Text = "A"; lNode.OnMouseOver += new OnMouseOverEventHandler(lNode_OnMouseOver); } private void lNode_OnMouseOver(object source, EventArgs e) { Response.Write(((TNode)source).Text); } Quote
Joe Mamma Posted January 16, 2006 Posted January 16, 2006 whoa wait a second. . . events are processed on postback. what you need to do is write javascript for the client side onhover event. . . thats the event in jscript right? onhover??? Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.