Raising Tip's Pop-Up Event on GotFocus ?

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Dear VB.NETers,

Does any one of you know how to raise up a tip's message when a control got
focus. For your info that I am using tooltip object and add it to two of my
controls on the form. Now, I'd like those two controls will raise the popup
tip's when they got focus. I know the got focus event, but what i need to do
to call the popup tip's event.

Regards,
Martin
 
Hi,

There isnt method to force a tooltip to show. Only thing I can
recomend is to set the tooltips initialdelay to a very low value so the
tooltip shows quicker.

http://msdn.microsoft.com/library/d...windowsformstooltipclassinitialdelaytopic.asp

Ken
----------------------
Dear VB.NETers,

Does any one of you know how to raise up a tip's message when a control got
focus. For your info that I am using tooltip object and add it to two of my
controls on the form. Now, I'd like those two controls will raise the popup
tip's when they got focus. I know the got focus event, but what i need to do
to call the popup tip's event.

Regards,
Martin
 
Use Windows API
Public Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos"
(ByVal x As Integer, ByVal y As Integer) As Integer
to trick the application.
For ex: Set cursor over textBox2 after textBox2 focused:

Dim mypt As Point
mypt = New Point(Me.TextBox2.Location.X + 5, Me.TextBox2.Location.Y + 3)
Dim mypt1 As Point = Me.PointToScreen(mypt)
SetCursorPos(mypt1.X, mypt1.Y)

It works fine.
 
Rulin,
Any reason you are using an API rather then using the .NET Cursor object
itself?

Something like:

Dim mypt As Point = TextBox2.Location
mypt.Offset(5, 3)
Cursor.Position = Me.PointToScreen(mypt)

For details see System.Windows.Forms.Cursor.

Hope this helps
Jay
 
You're right.

Jay B. Harlow said:
Rulin,
Any reason you are using an API rather then using the .NET Cursor object
itself?

Something like:

Dim mypt As Point = TextBox2.Location
mypt.Offset(5, 3)
Cursor.Position = Me.PointToScreen(mypt)

For details see System.Windows.Forms.Cursor.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top