473,805 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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***********@r ambler.ru
Nov 16 '05 #1
5 9783
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***********@r ambler.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_NOTI FY )
{
NMHDR nm =(NMHDR) m.GetLParam(typ eof(NMHDR));
if (nm.code==HDN_I TEMCHANGEDW)
{
int right=0;
int left=0;
TOOLINFO ti=new TOOLINFO();
ti.cbSize=Marsh al.SizeOf(ti);
ti.uFlags=TTF_S UBCLASS;
ti.hWnd=headerH andle;
for (int i=0; i<this.Columns. Count; i++)
{
if (i<this.Columns .Count)
right+=this.Col umns[i].Width;
else
right=this.Widt h;
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(too lTipHandle, TTM_DELTOOLW, 0, ref ti);
SendMessage(too lTipHandle, TTM_ADDTOOLW, 0, ref ti);
left=right;
}
}
}
base.WndProc (ref m);
}
"cyrille" <cy*******@kbui lder.net> ???????/???????? ? ???????? ?????????:
news:Oo******** *****@tk2msftng p13.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_NOTI FY )
{
NMHDR nm =(NMHDR) m.GetLParam(typ eof(NMHDR));
if (nm.code==HDN_I TEMCHANGEDW)
{
int right=0;
int left=0;
TOOLINFO ti=new TOOLINFO();
ti.cbSize=Marsh al.SizeOf(ti);
ti.uFlags=TTF_S UBCLASS;
ti.hWnd=headerH andle;
for (int i=0; i<this.Columns. Count; i++)
{
if (i<this.Columns .Count)
right+=this.Col umns[i].Width;
else
right=this.Widt h;
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(too lTipHandle, TTM_DELTOOLW, 0, ref ti);
SendMessage(too lTipHandle, TTM_ADDTOOLW, 0, ref ti);
left=right;
}
}
}
base.WndProc (ref m);
}


How do you initialize 'headerHandle' ?

cyrille
Nov 16 '05 #5
headerHandle = (IntPtr)SendMes sage((int)Handl e, LVM_GETHEADER,0 ,0);

"cyrille" <cy*******@kbui lder.net> ???????/???????? ? ???????? ?????????:
news:uY******** ******@TK2MSFTN GP10.phx.gbl...
Yura Moldavanov wrote:
protected override void WndProc(ref Message m)
{
if (m.Msg==WM_NOTI FY )
{
NMHDR nm =(NMHDR) m.GetLParam(typ eof(NMHDR));
if (nm.code==HDN_I TEMCHANGEDW)
{
int right=0;
int left=0;
TOOLINFO ti=new TOOLINFO();
ti.cbSize=Marsh al.SizeOf(ti);
ti.uFlags=TTF_S UBCLASS;
ti.hWnd=headerH andle;
for (int i=0; i<this.Columns. Count; i++)
{
if (i<this.Columns .Count)
right+=this.Col umns[i].Width;
else
right=this.Widt h;
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(too lTipHandle, TTM_DELTOOLW, 0, ref ti);
SendMessage(too lTipHandle, 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
1459
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 move the listview so the right-most columns are visible on the form, they are not repainted. I get a blank area where the column header should be.
3
4572
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, LVM_GETHEADER,0,0)
2
4968
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 TextAlign = right, the icon disppeared. Is somebody has a solution? Thanks
1
2072
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 As Long, _ ByVal imgIconNo As Long, _ ByVal showImage As Long) Dim hHeader As IntPtr Dim HD As HD_ITEM
1
7794
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
1561
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
34029
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
1814
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
1999
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 succeed in changing the back and fore colors of the data displayed in the listview but cant find a way of doing so to the column header. Thank you again for all the help.
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10614
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.