Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clear keyboard buffer

Status
Not open for further replies.

NICKYSUWANDI

Programmer
Jan 8, 2004
80
ID
i had download procedure to create Balontips, this procedure display finely when using procedure mouse_hover (call balontips from this procedure).

i want this balontips actived when user press function key F1.
so i call this procedure from Key_down procedure.

My problem is when user push F1 the balontips is display an quickly gone so user can't read the message.

I think this because user push F1 key, so i want ask theres anyway to clear keyboard buffer or there are any advised to solve this problem.

Thanks

Nicky
 
You mean baloontips :)
this may help:)

Showing Balloon Tips
If your application is running on a system with Shell version 5.00 or above (Windows Me and Windows 2000 are the minimum versions for this Shell version) then you can pop-up Balloon Tips to provide the user with information or warning messages. The balloon tips themselves are queued by the operating system, so if there is already one displayed then you need to wait until it is cleared by the user or the system decides to the tip out.

To display a balloon tip, call the ShowBalloonTip passing in the message to display and optionally the title of the tip, the icon to show (which also affects the overall appearance of the tip - for example, a warning tip shows in a different colour to an information tip) and the timeout to use. The SysTray form has these events to notify what has happened:

BalloonShow - Raised when your Balloon tip is shown.
BalloonHide - Raised if the Balloon tip is hidden for a reason other than the user clicking it or it timing out.
BalloonClick - Raised if the user clicks on the Balloon Tip itself. This indicates acceptance of the information in the tip.
BalloonTimeOut - Raised if the balloon tip times out. Note that this is also raised on XP systems if the user clicks the Close button for the tip.


 
thanks for u advise chmohan, but i need to run this program in Windows 98.
i post my ballontips class, i just need to show this ballontips to users when user pressing F1 (quickly disappear when pressing F1 but this work when using mousehover)

Thansk

Nicky

---------------------my code
Public Class BallonTip
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As EDITBALLOONTIP) As Integer
Private Const ECM_FIRST = &H1500
Private Const EM_SHOWBALLOONTIP = ECM_FIRST + 3

<StructLayout(LayoutKind.Sequential)> _
Private Structure EDITBALLOONTIP
Dim cbStruct As Integer
<MarshalAs(UnmanagedType.LPWStr)> Dim pszTitle As String
<MarshalAs(UnmanagedType.LPWStr)> Dim pszText As String
Dim ttiIcon As Integer
End Structure

Public Enum BallonTipIcons As Integer
None
Info
Exclamation
Critical
Blank
End Enum

Public Shared Sub ShowEditTip(ByVal targetTextBox As TextBox, ByVal title As String, ByVal text As String, ByVal tipIcon As BallonTipIcons)
If Environment.OSVersion.Version.Major = 5 AndAlso Environment.OSVersion.Version.Minor = 1 Then
Dim stTip As EDITBALLOONTIP
With stTip
.cbStruct = Marshal.SizeOf(GetType(EDITBALLOONTIP))
.pszText = text
.pszTitle = title
.ttiIcon = tipIcon
End With
SendMessage(targetTextBox.Handle, EM_SHOWBALLOONTIP, 0, stTip)
End If
End Sub
end class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top