Click here to Skip to main content
15,888,816 members
Home / Discussions / C#
   

C#

 
AnswerRe: grabbing focus with a Pop-up? Pin
Paul Riley18-Oct-02 3:46
Paul Riley18-Oct-02 3:46 
GeneralRe: grabbing focus with a Pop-up? Pin
Dave Gustafson18-Oct-02 4:36
Dave Gustafson18-Oct-02 4:36 
GeneralRe: grabbing focus with a Pop-up? Pin
Paul Riley18-Oct-02 4:46
Paul Riley18-Oct-02 4:46 
GeneralRe: grabbing focus with a Pop-up? Pin
Dave Gustafson18-Oct-02 12:33
Dave Gustafson18-Oct-02 12:33 
GeneralRe: grabbing focus with a Pop-up? Pin
Paul Riley18-Oct-02 13:20
Paul Riley18-Oct-02 13:20 
GeneralRe: grabbing focus with a Pop-up? Pin
Dave Gustafson18-Oct-02 16:53
Dave Gustafson18-Oct-02 16:53 
GeneralRe: grabbing focus with a Pop-up? Pin
Dave Gustafson20-Oct-02 5:14
Dave Gustafson20-Oct-02 5:14 
GeneralRe: grabbing focus with a Pop-up? Pin
Paul Riley20-Oct-02 5:22
Paul Riley20-Oct-02 5:22 
GeneralC# and DLL calling Pin
Ceri17-Oct-02 23:36
Ceri17-Oct-02 23:36 
GeneralRe: C# and DLL calling Pin
Paul Riley17-Oct-02 23:46
Paul Riley17-Oct-02 23:46 
GeneralRe: C# and DLL calling Pin
Stephane Rodriguez.18-Oct-02 1:19
Stephane Rodriguez.18-Oct-02 1:19 
GeneralNeed help on this issue with WebBrowser control Pin
GriffonRL17-Oct-02 22:28
GriffonRL17-Oct-02 22:28 
GeneralRe: Need help on this issue with WebBrowser control Pin
Sijin18-Oct-02 0:53
Sijin18-Oct-02 0:53 
GeneralRe: Need help on this issue with WebBrowser control Pin
GriffonRL18-Oct-02 1:05
GriffonRL18-Oct-02 1:05 
GeneralRe: Need help on this issue with WebBrowser control Pin
Stephane Rodriguez.18-Oct-02 1:16
Stephane Rodriguez.18-Oct-02 1:16 
GeneralRe: Need help on this issue with WebBrowser control Pin
GriffonRL18-Oct-02 1:20
GriffonRL18-Oct-02 1:20 
GeneralRe: Need help on this issue with WebBrowser control Pin
Stephane Rodriguez.18-Oct-02 1:31
Stephane Rodriguez.18-Oct-02 1:31 
GeneralRe: Need help on this issue with WebBrowser control Pin
Sijin18-Oct-02 4:37
Sijin18-Oct-02 4:37 
QuestionIn COM+ environment, my value-object needs support strongly named assembly and others? Pin
17-Oct-02 16:18
suss17-Oct-02 16:18 
QuestionHow can I detect when a context menu is displayed Pin
Darryl Borden17-Oct-02 10:46
Darryl Borden17-Oct-02 10:46 
AnswerRe: How can I detect when a context menu is displayed Pin
Wjousts17-Oct-02 16:27
Wjousts17-Oct-02 16:27 
GeneralRe: How can I detect when a context menu is displayed Pin
Darryl Borden18-Oct-02 5:11
Darryl Borden18-Oct-02 5:11 
GeneralToolTip for TreeView nodes Pin
kavehdr17-Oct-02 10:40
kavehdr17-Oct-02 10:40 
GeneralRe: ToolTip for TreeView nodes Pin
Russell Morris17-Oct-02 12:23
Russell Morris17-Oct-02 12:23 
GeneralRe: ToolTip for TreeView nodes Pin
Patrick Lassalle17-Oct-02 13:06
Patrick Lassalle17-Oct-02 13: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; }
}
}

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.