472,780 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 software developers and data experts.

ToolTips on ListView Header

Hello, All!

I have a problem with putting the ToolTips on ListView Header

ToolTip Text Property must changes depending on column, which is under
mosue cursor.

Problem 1. Standatr .Net class TooTip is not shown, when mouse not in the
client area of ListView.
I trying to solve this through Win Api CreateEx function, SendMessage e t.c.
But therein lies a problem for me that I can't to know which column is under
mouse cursor.

Please help me to find optimal solution how to set ToolTip on LiseView
Header, which show the current column Title...
--
Best Regards
---------------------------
Moldavanov Yura
ICQ#: 247077081
e-mail: un***********@rambler.ru
Nov 16 '05 #1
5 9621
I think I solve this question :)

Can I do it without WINAPI SendMessage () ?

"Yura Moldavanov" <un***********@rambler.ru> сообщил/сообщила в новостях
следующее: news:2p************@uni-berlin.de...
Hello, All!

I have a problem with putting the ToolTips on ListView Header

ToolTip Text Property must changes depending on column, which is under
mosue cursor.

Problem 1. Standatr .Net class TooTip is not shown, when mouse not in the
client area of ListView.
I trying to solve this through Win Api CreateEx function, SendMessage e t.c. But therein lies a problem for me that I can't to know which column is under mouse cursor.

Please help me to find optimal solution how to set ToolTip on LiseView
Header, which show the current column Title...
--
Best Regards
---------------------------
Moldavanov Yura
ICQ#: 247077081
e-mail: un***********@rambler.ru

Nov 16 '05 #2
Yura Moldavanov wrote:
I think I solve this question :)


How ?

Nov 16 '05 #3
If you wish I can send full source code to your e-mail.
-------------------------------------------------------

protected override void WndProc(ref Message m)
{
if (m.Msg==WM_NOTIFY )
{
NMHDR nm =(NMHDR) m.GetLParam(typeof(NMHDR));
if (nm.code==HDN_ITEMCHANGEDW)
{
int right=0;
int left=0;
TOOLINFO ti=new TOOLINFO();
ti.cbSize=Marshal.SizeOf(ti);
ti.uFlags=TTF_SUBCLASS;
ti.hWnd=headerHandle;
for (int i=0; i<this.Columns.Count; i++)
{
if (i<this.Columns.Count)
right+=this.Columns[i].Width;
else
right=this.Width;
ti.uID=i;
if (i<this.Columns.Count)
ti.pszText=this.Columns[i].Text;
else
ti.pszText="";
Rectangle rect= new System.Drawing.Rectangle(left,0,right,20);
ti.rect=rect;
// SendMessage(toolTipHandle, TTM_DELTOOLW, 0, ref ti);
SendMessage(toolTipHandle, TTM_ADDTOOLW, 0, ref ti);
left=right;
}
}
}
base.WndProc (ref m);
}
"cyrille" <cy*******@kbuilder.net> ???????/???????? ? ???????? ?????????:
news:Oo*************@tk2msftngp13.phx.gbl...
Yura Moldavanov wrote:
I think I solve this question :)


How ?

Nov 16 '05 #4
Yura Moldavanov wrote:
protected override void WndProc(ref Message m)
{
if (m.Msg==WM_NOTIFY )
{
NMHDR nm =(NMHDR) m.GetLParam(typeof(NMHDR));
if (nm.code==HDN_ITEMCHANGEDW)
{
int right=0;
int left=0;
TOOLINFO ti=new TOOLINFO();
ti.cbSize=Marshal.SizeOf(ti);
ti.uFlags=TTF_SUBCLASS;
ti.hWnd=headerHandle;
for (int i=0; i<this.Columns.Count; i++)
{
if (i<this.Columns.Count)
right+=this.Columns[i].Width;
else
right=this.Width;
ti.uID=i;
if (i<this.Columns.Count)
ti.pszText=this.Columns[i].Text;
else
ti.pszText="";
Rectangle rect= new System.Drawing.Rectangle(left,0,right,20);
ti.rect=rect;
// SendMessage(toolTipHandle, TTM_DELTOOLW, 0, ref ti);
SendMessage(toolTipHandle, TTM_ADDTOOLW, 0, ref ti);
left=right;
}
}
}
base.WndProc (ref m);
}


How do you initialize 'headerHandle' ?

cyrille
Nov 16 '05 #5
headerHandle = (IntPtr)SendMessage((int)Handle, LVM_GETHEADER,0,0);

"cyrille" <cy*******@kbuilder.net> ???????/???????? ? ???????? ?????????:
news:uY**************@TK2MSFTNGP10.phx.gbl...
Yura Moldavanov wrote:
protected override void WndProc(ref Message m)
{
if (m.Msg==WM_NOTIFY )
{
NMHDR nm =(NMHDR) m.GetLParam(typeof(NMHDR));
if (nm.code==HDN_ITEMCHANGEDW)
{
int right=0;
int left=0;
TOOLINFO ti=new TOOLINFO();
ti.cbSize=Marshal.SizeOf(ti);
ti.uFlags=TTF_SUBCLASS;
ti.hWnd=headerHandle;
for (int i=0; i<this.Columns.Count; i++)
{
if (i<this.Columns.Count)
right+=this.Columns[i].Width;
else
right=this.Width;
ti.uID=i;
if (i<this.Columns.Count)
ti.pszText=this.Columns[i].Text;
else
ti.pszText="";
Rectangle rect= new System.Drawing.Rectangle(left,0,right,20);
ti.rect=rect;
// SendMessage(toolTipHandle, TTM_DELTOOLW, 0, ref ti);
SendMessage(toolTipHandle, TTM_ADDTOOLW, 0, ref ti);
left=right;
}
}
}
base.WndProc (ref m);
}


How do you initialize 'headerHandle' ?

cyrille

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gates 72 | last post by:
Hello All, I am seeing something annoying with the listview. I have a listview that spans an area greater than the width of my form, and have a scrollbar that moves it left and right. When I...
3
by: Simon Abolnar | last post by:
I am using VB.NET 2003 Framework 1.1 How can I get ListView header handle. I tried in this way: Dim headerHandle As IntPtr HeaderHandle=SendMessage(listView.Handle.ToInt32,...
2
by: Li Pang | last post by:
Hi, I used some code to add an arrow icon onto a listview header column for the sorting purpose. However, after the icon added, the TextAlign of the column becomes "left", if I enforced...
1
by: Lespaul36 | last post by:
I want to put an Icon on the right side of a column header when the column is clicked I found some basic code that I am trying to use, but nothing so far. Public Sub ShowHeaderIcon(ByVal colNo...
1
by: Brian Keating | last post by:
Hi there, Does anyone know how to make the header height of a ListView bigger? Should i set font or something , any ideas appreciated. Thanks Brian
0
by: Diogo Alves - Software Developer | last post by:
Hi, I would like to put the mouse over a listview header and then display a tooltip with the description of what that header represents... How can I do that Thanks in advance. Best REgards
7
by: > Adrian | last post by:
How do I change the ListView Header Color? If you know how to do it, please give a code example. Adrian. (I placed this question in another newsgroup by error.)
1
by: John Rogers | last post by:
Does anyone have a snippet that shows how to put the sorting arrow in the listview header? Something simple and not any of the sorting code for sorting the data. Thanks John-
1
Kabyr
by: Kabyr | last post by:
In my application, specific colors are required to match the theme color of the organisation. i.e. Blue forecolor/Yellow backcolor. However, I use listview to present some reports to the users. I...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.