Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
GeneralRe: Retrieve the value of Inout parameter Pin
miah alom25-Aug-05 11:52
miah alom25-Aug-05 11:52 
GeneralRe: Retrieve the value of Inout parameter Pin
tsramkumar25-Aug-05 12:56
tsramkumar25-Aug-05 12:56 
AnswerRe: Retrieve the value of Inout parameter Pin
Luis Alonso Ramos25-Aug-05 17:19
Luis Alonso Ramos25-Aug-05 17:19 
GeneralRe: Retrieve the value of Inout parameter Pin
tsramkumar26-Aug-05 1:35
tsramkumar26-Aug-05 1:35 
Questionxs:date type in DataSet Pin
tadass25-Aug-05 11:10
tadass25-Aug-05 11:10 
QuestionUsing ArrayList Pin
MarkMokris25-Aug-05 10:49
MarkMokris25-Aug-05 10:49 
AnswerRe: Using ArrayList Pin
gnjunge25-Aug-05 10:54
gnjunge25-Aug-05 10:54 
GeneralRe: Using ArrayList Pin
Daniel132425-Aug-05 13:33
Daniel132425-Aug-05 13:33 
AnswerRe: Using ArrayList Pin
Matt Gerrans25-Aug-05 16:59
Matt Gerrans25-Aug-05 16:59 
AnswerRe: Using ArrayList Pin
Luis Alonso Ramos25-Aug-05 17:12
Luis Alonso Ramos25-Aug-05 17:12 
GeneralRe: Using ArrayList Pin
Kevin McFarlane26-Aug-05 0:33
Kevin McFarlane26-Aug-05 0:33 
AnswerRe: Using ArrayList Pin
radic.feng26-Aug-05 1:23
radic.feng26-Aug-05 1:23 
QuestionJob Scheduler Pin
mohitTheOne25-Aug-05 9:46
mohitTheOne25-Aug-05 9:46 
AnswerRe: Job Scheduler Pin
miah alom25-Aug-05 11:45
miah alom25-Aug-05 11:45 
QuestionSubclassing in .NET Pin
Luis Alonso Ramos25-Aug-05 9:43
Luis Alonso Ramos25-Aug-05 9:43 
AnswerRe: Subclassing in .NET Pin
Daniel Turini25-Aug-05 10:31
Daniel Turini25-Aug-05 10:31 
GeneralRe: Subclassing in .NET Pin
Luis Alonso Ramos25-Aug-05 16:59
Luis Alonso Ramos25-Aug-05 16:59 
Answer[Message Deleted] Pin
miah alom25-Aug-05 11:59
miah alom25-Aug-05 11:59 
QuestionSetting the exact position of a tooltip Pin
Luis Alonso Ramos25-Aug-05 9:37
Luis Alonso Ramos25-Aug-05 9:37 
AnswerRe: Setting the exact position of a tooltip Pin
miah alom25-Aug-05 12:00
miah alom25-Aug-05 12:00 
I guess this is all you need. Give me a candy if this works for you.

private void ListControlMouseMove(object sender, MouseEventArgs e)
{
Point ptOnlist = Point.Empty;
ListViewItem item = null;
int subItemIndex = -1;
int subItemTextWidth = -1;
ListViewItem.ListViewSubItem curSubItem = null;

if (e.Button == MouseButtons.None)
{
item = this.GetItemAt(e.X, e.Y);
if (item != null)
{
subItemIndex = this.GetSubItemIndexFromPoint(item, new Point(e.X, e.Y));
if (subItemIndex != -1)
{
curSubItem = item.SubItems[subItemIndex];
if (curSubItem != null)
{
if (curSubItem.Text.Length > 0)
{
subItemTextWidth = this.ListViewGetStringWidth(curSubItem.Text);
if (subItemTextWidth != -1)
{
subItemTextWidth += 12;
if (subItemTextWidth > this.Columns[subItemIndex].Width)
{
this.SetToolTipText(curSubItem.Text);
}
else
{
this.HideToolTip();
}
}
}
}
}
else
{
this.HideDynamicControls();
}
}
}
}


protected int GetSubItemIndexFromPoint(ListViewItem item, Point ptInList)
{
int sumOfWidths = 0;
int columnIndex = 0;

foreach (ColumnHeader column in this.Columns)
{
if (sumOfWidths < ptInList.X && ptInList.X < sumOfWidths + column.Width)
{
return columnIndex;
}
sumOfWidths += column.Width;
columnIndex++;
}
return -1;
}

private const int LVM_GETSTRINGWIDTHW = 4183
protected int ListViewGetStringWidth(string subItemText)
{
IntPtr hString = Marshal.StringToHGlobalAuto(subItemText);
int width = UnsafeNativeMethods.SendMessage(this.Handle, LVM_GETSTRINGWIDTHW, 0, hString);
Marshal.FreeHGlobal(hString);

return width;
}

protected void SetToolTipText(string toolTipText)
{
if (toolTipText != null)
{
this.toolTip.Active = true;
this.toolTip.SetToolTip(this, toolTipText);
}
}

Cheers.
GeneralRe: Setting the exact position of a tooltip Pin
Luis Alonso Ramos25-Aug-05 16:47
Luis Alonso Ramos25-Aug-05 16:47 
GeneralRe: Setting the exact position of a tooltip Pin
miah alom26-Aug-05 11:03
miah alom26-Aug-05 11:03 
GeneralRe: Setting the exact position of a tooltip Pin
Luis Alonso Ramos26-Aug-05 16:31
Luis Alonso Ramos26-Aug-05 16:31 
GeneralRe: Setting the exact position of a tooltip Pin
Alomgir Miah26-Aug-05 17:31
Alomgir Miah26-Aug-05 17:31 
GeneralRe: Setting the exact position of a tooltip Pin
Luis Alonso Ramos26-Aug-05 22:08
Luis Alonso Ramos26-Aug-05 22:08 

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.