473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 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 9712
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.