• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

Yellow help box

Hello, i want to know how to show a yellow help box when the mouse is over a row from a datagrid.

Actually i have isolated the row I just need to know how to pop up the yellow help box when mouse over it. You know, this box that you don't need to click Ok or anything, just like a comment bubble.


Thanks
0
TheSonics
Asked:
TheSonics
  • 5
  • 3
1 Solution
 
Bob LearnedCommented:
1) .NET version

2) You are looking to set a ToolTip.

Bob
0
 
TheSonicsAuthor Commented:
Yeah tooltip

ToolTip1 as New ToolTip
ToolTip1.setTip(control, string)
the problem is that i do not know what control to link with.


Framework 1.1
0
 
TheSonicsAuthor Commented:
And to be more exact, i wish to link every component of my datagrid to a tooltip, i was thinking of doing a check on the row number and simply link to a column.
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Bob LearnedCommented:
1) Use the DataGrid MouseMove event

2) Perform a HitTest on the mouse coordinates

3) Get the RowIndex from the HitTest

4) Get the value to display as help

5) Set the Tooltip to the DataGrid, and the help value that you got from the DataGrid.

Bob
0
 
TheSonicsAuthor Commented:
I did all of this, but the Tooltip is linked to the whole datagrid, so as long as the mouse is on the datagrid the tooltip stays poped
0
 
TheSonicsAuthor Commented:
Is there a way (like CType) that i could convert a System.Data.DataColumn to System.windows.form ?
0
 
Bob LearnedCommented:
Are you asking a different question, or does that apply to this question?

Bob
0
 
TheSonicsAuthor Commented:
Well, it is a clearer question :


Tooltip requires a control of type System.windows.form, linking to the whole DataGrid is working, but the tooltip will stay visible as long as the mouse is somewhere in the Datagrid (which represent the whole form). So I was kinda wondering if there was a way to link my Tiptool to the column. Another interesting would be to derivated a class where the visible option. I'd rather use some .NET tools.


Best Regards.
0
 
GilesBathgateCommented:
You cant cast one type of thing into another type of thing unless they are both on the same leg of the class heirachy
 
            Object
              / \
           Control
           /        \
         /           \
DataColumn    Form
                        \
                       WindowsApplication1.Form1

E.g
Dim myForm As New WindowsApplication1.Form1
CType(myForm,Form)
or
Dim myForm as new WindowApplication1.Form1
CType(myForm,Contol)
or
Dim myDataColumn as new DataCloumn
CType(myDataColumn,Control)

BUT DEFFINATELY NOT

Dim myDataColumn as new DataCloumn
CType(myDataColumn,Form)


Anyway as for your tooltip problem .Net Framework 1.1 is a pain in the way it handles tooltips. and the support is alot better in .Net 2.0 where you can actually show it when and where to display any tooltip and make it hide whenever you like too.

The solution we came up with for 1.1 was to use unmanaged API calls to provide a better more flexible Tooltip framework.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now