Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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);

}

  • 2 weeks later...
Posted

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???

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...