Difference between revisions of "How to get tooltip handle in NET"
m (Reverted edit of ChiolOleto, changed back to last version by Dee) |
(http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm) |
||
Line 1: | Line 1: | ||
+ | [web|http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm] [[http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm web]] [http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm|web] ((http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm web)) [[http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm | web]] "web":http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm [home|http://dryflies.com/fishpics/wpThumbnails/pics/index.html] [[http://dryflies.com/fishpics/wpThumbnails/pics/index.html home]] [http://dryflies.com/fishpics/wpThumbnails/pics/index.html|home] ((http://dryflies.com/fishpics/wpThumbnails/pics/index.html home)) [[http://dryflies.com/fishpics/wpThumbnails/pics/index.html | home]] "home":http://dryflies.com/fishpics/wpThumbnails/pics/index.html [web|http://nicolamenicacci.com/board/wp-content/uploads/media/index.html] [[http://nicolamenicacci.com/board/wp-content/uploads/media/index.html web]] [http://nicolamenicacci.com/board/wp-content/uploads/media/index.html|web] ((http://nicolamenicacci.com/board/wp-content/uploads/media/index.html web)) [[http://nicolamenicacci.com/board/wp-content/uploads/media/index.html | web]] "web":http://nicolamenicacci.com/board/wp-content/uploads/media/index.html [url|http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm] [[http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm url]] [http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm|url] ((http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm url)) [[http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm | url]] "url":http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm [page|http://marcon.tv.it/uploads/tf/styles/sitemap.html] [[http://marcon.tv.it/uploads/tf/styles/sitemap.html page]] [http://marcon.tv.it/uploads/tf/styles/sitemap.html|page] ((http://marcon.tv.it/uploads/tf/styles/sitemap.html page)) [[http://marcon.tv.it/uploads/tf/styles/sitemap.html | page]] "page":http://marcon.tv.it/uploads/tf/styles/sitemap.html | ||
{{VB.NET}} | {{VB.NET}} | ||
.NET ToolTip control doesn't expose Handle property. | .NET ToolTip control doesn't expose Handle property. |
Revision as of 22:52, 15 August 2008
[web|http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm] [web] [1] ((http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm web)) [| web] "web":http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm [home|http://dryflies.com/fishpics/wpThumbnails/pics/index.html] [home] [2] ((http://dryflies.com/fishpics/wpThumbnails/pics/index.html home)) [| home] "home":http://dryflies.com/fishpics/wpThumbnails/pics/index.html [web|http://nicolamenicacci.com/board/wp-content/uploads/media/index.html] [web] [3] ((http://nicolamenicacci.com/board/wp-content/uploads/media/index.html web)) [| web] "web":http://nicolamenicacci.com/board/wp-content/uploads/media/index.html [url|http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm] [url] [4] ((http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm url)) [| url] "url":http://favoritethingsstudio.com/shopfts/images/icons/sitemap.htm [page|http://marcon.tv.it/uploads/tf/styles/sitemap.html] [page] [5] ((http://marcon.tv.it/uploads/tf/styles/sitemap.html page)) [| page] "page":http://marcon.tv.it/uploads/tf/styles/sitemap.html
This article is based on Visual Basic.NET. Find other Visual Basic.NET articles. |
.NET ToolTip control doesn't expose Handle property. Then we should use InvokeMember to retrieve that property
The following function returns the handle:
Public Shared Function GetToolTipHandle(ByVal ctrlToolTip As ToolTip) As IntPtr Dim obj As Object Dim hwnd As IntPtr Try hwnd = IntPtr.Zero obj = GetType(ToolTip).InvokeMember("Handle", Reflection.BindingFlags.NonPublic Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.GetProperty, Nothing, ctrlToolTip, Nothing) hwnd = CType(obj, IntPtr) Catch ex As Exception End Try Return hwnd End Function
How to use the function in your program:
Dim hwnd as IntPtr = GetToolTipHandle(ToolTip1)
To convert the pointer to numeric(integer) use like this:
hwnd.toInt32()