Click here to Skip to main content
15,848,904 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need help on this issue with WebBrowser control Pin
Sijin18-Oct-02 5:37
Sijin18-Oct-02 5:37 
QuestionIn COM+ environment, my value-object needs support strongly named assembly and others? Pin
17-Oct-02 17:18
suss17-Oct-02 17:18 
QuestionHow can I detect when a context menu is displayed Pin
Darryl Borden17-Oct-02 11:46
Darryl Borden17-Oct-02 11:46 
AnswerRe: How can I detect when a context menu is displayed Pin
Wjousts17-Oct-02 17:27
Wjousts17-Oct-02 17:27 
GeneralRe: How can I detect when a context menu is displayed Pin
Darryl Borden18-Oct-02 6:11
Darryl Borden18-Oct-02 6:11 
GeneralToolTip for TreeView nodes Pin
kavehdr17-Oct-02 11:40
kavehdr17-Oct-02 11:40 
GeneralRe: ToolTip for TreeView nodes Pin
Russell Morris17-Oct-02 13:23
Russell Morris17-Oct-02 13:23 
GeneralRe: ToolTip for TreeView nodes Pin
Patrick Lassalle17-Oct-02 14:06
Patrick Lassalle17-Oct-02 14:06 
In the following example, I use a Tootip control and I create a new class derived from the TreeNode class. This class contains a Tooltip property. And I display the tooltip when receiving the MouseMove event, using the GetNodeAt method to know what is the node pointed by the mouse.

using System;
using System.Drawing;
using System.Windows.Forms;

class TreeViewWithTooltip: Form
{
private ToolTip m_tooltipCtrl = null;

public static void Main()
{
Application.Run(new TreeViewWithTooltip());
}

public TreeViewWithTooltip()
{
Text = "Tree View with tooltip";
m_tooltipCtrl = new ToolTip();

TreeView tree = new TreeView();
tree.Parent = this;
tree.Dock = DockStyle.Fill;
tree.ShowLines = true;
tree.MouseMove += new System.Windows.Forms.MouseEventHandler(tree_MouseMove);

MyTreeNode myTreeNode1 = new MyTreeNode("This is node 1");
myTreeNode1.Text = "node1";
tree.Nodes.Add(myTreeNode1);
MyTreeNode myTreeNode11 = new MyTreeNode("This is node 11");
myTreeNode11.Text = "node11";
myTreeNode1.Nodes.Add(myTreeNode11);
tree.ExpandAll();
}

private void tree_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
TreeView tree = (TreeView)sender;
MyTreeNode myTreeNode = (MyTreeNode)tree.GetNodeAt(e.X, e.Y);
m_tooltipCtrl.SetToolTip(tree, myTreeNode != null ? myTreeNode.Tooltip : null);
}
}

class MyTreeNode : TreeNode
{
private string m_tooltip;
public MyTreeNode(string tooltip)
{
m_tooltip = tooltip;
}
public string Tooltip
{
get { return m_tooltip; }
set { m_tooltip = value; }
}
}
GeneralRe: ToolTip for TreeView nodes Pin
kavehdr17-Oct-02 16:57
kavehdr17-Oct-02 16:57 
GeneralDelete files that are in use Pin
Ola Carlsson17-Oct-02 9:57
Ola Carlsson17-Oct-02 9:57 
GeneralRe: Delete files that are in use Pin
Paul Riley17-Oct-02 10:54
Paul Riley17-Oct-02 10:54 
GeneralRe: Delete files that are in use Pin
JasonSmith18-Oct-02 14:21
JasonSmith18-Oct-02 14:21 
GeneralRe: Delete files that are in use Pin
Paul Riley18-Oct-02 14:39
Paul Riley18-Oct-02 14:39 
GeneralExibiting more control over remote assembly download Pin
Richard Smith17-Oct-02 5:25
Richard Smith17-Oct-02 5:25 
GeneralRe: Exibiting more control over remote assembly download Pin
Russell Morris17-Oct-02 8:54
Russell Morris17-Oct-02 8:54 
GeneralRe: Exibiting more control over remote assembly download Pin
Richard Smith17-Oct-02 12:37
Richard Smith17-Oct-02 12:37 
GeneralClickety Police! Pin
David Stone17-Oct-02 13:04
sitebuilderDavid Stone17-Oct-02 13:04 
QuestionMFC to C# ?? Pin
-Dy17-Oct-02 3:44
-Dy17-Oct-02 3:44 
AnswerRe: MFC to C# ?? Pin
Michael P Butler17-Oct-02 3:48
Michael P Butler17-Oct-02 3:48 
GeneralRe: MFC to C# ?? Pin
-Dy17-Oct-02 3:54
-Dy17-Oct-02 3:54 
GeneralRe: MFC to C# ?? Pin
Paul Riley17-Oct-02 4:07
Paul Riley17-Oct-02 4:07 
GeneralRe: MFC to C# ?? Pin
Michael P Butler17-Oct-02 4:24
Michael P Butler17-Oct-02 4:24 
AnswerRe: MFC to C# ?? Pin
Stephane Rodriguez.17-Oct-02 4:48
Stephane Rodriguez.17-Oct-02 4:48 
GeneralRe: MFC to C# ?? Pin
KaЯl17-Oct-02 12:14
KaЯl17-Oct-02 12:14 
GeneralRe: MFC to C# ?? Pin
Stephane Rodriguez.17-Oct-02 21:23
Stephane Rodriguez.17-Oct-02 21:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.