Option Explicit 'Usarlo como ToolTip... 25/Oct/95 Global NoMostrarTip As Integer 'Para no mostrar, usarla cuando haya Ventanas MODAL Global flagToolTip As Integer 'Si se muestra como Tip Global btnToolTip As Integer 'Botón pulsado para Tip 'Declaración para usar ventanas siempre visibles Declare Function SetWindowPos Lib "User" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer ' SetWindowPos Flags Global Const SWP_NOSIZE = &H1 Global Const SWP_NOMOVE = &H2 Global Const SWP_NOACTIVATE = &H10 Global Const SWP_SHOWWINDOW = &H40 Global Const SWP_FLAGS = SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW Or SWP_NOACTIVATE Sub MostrarNota (msg As String, frm As Form, ctrl As Control, Y As Single, X As Single) Dim i As Integer Dim TipoScaleMode As Integer Dim frmTop As Integer Dim frmLeft As Integer Const TWIPS = 120 On Error Resume Next 'Por si Form es MDIForm (23/Oct/94) If NoMostrarTip Then Exit Sub TipoScaleMode = frm.ScaleMode frm.ScaleMode = 1 'twip If Err Then 'Si es MDIForm frmTop = frm.Top + Y + gsw_Nota.Height Else frmTop = frm.Top + Y + ctrl.Height End If frmLeft = frm.Left + ctrl.Left frmTop = frmTop + TWIPS + 60 If frm.BorderStyle Then If frm.ControlBox = 0 And frm.Caption = "" Then frmTop = frmTop + TWIPS + 30 Else frmTop = frmTop + TWIPS * 3 - 60 End If End If gsw_Nota!Label1.AutoSize = True gsw_Nota!Label1.Caption = " " & msg & " " gsw_Nota!Label1.AutoSize = False ' gsw_Nota!Label1.Height = gsw_Nota!Label1.Height + 30 gsw_Nota!Label1.Left = 0 gsw_Nota!Label1.Top = 0 gsw_Nota.Width = gsw_Nota!Label1.Width gsw_Nota.Height = gsw_Nota!Label1.Height gsw_Nota.Top = frmTop '+ gsw_Nota.Height gsw_Nota.Left = frmLeft + 60 If gsw_Nota.Top < 0 Then gsw_Nota.Top = 0 If gsw_Nota.Left + gsw_Nota.Width > Screen.Width Then gsw_Nota.Left = Screen.Width - gsw_Nota.Width End If i = SetWindowPos(gsw_Nota.hWnd, -1, 0, 0, 0, 0, SWP_FLAGS) 'gsw_Nota.Refresh gsw_Nota.Visible = True 'Show frm.ScaleMode = TipoScaleMode End Sub Sub QuitarNota () btnToolTip = -1 gsw_Nota.Visible = False End Sub