Advertisement
TrunghieuTH10

GuiToolTip

Oct 9th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.73 KB | None | 0 0
  1. #include <StringSize.au3>
  2.  
  3. Func _GUIToolTip($text,$Width,$height,$GuiBkColor,$textColor,$timeout=1)
  4.     Local $x = ($Width-StringLen($text)*4.5-StringLen($text)*4.5/2)/2-0.5
  5.     If $x < 2 Then $x = 2
  6.     Local $y = $height/2 - _StringSize($text)[3]/2
  7.     Local $guitooltip = GUICreate("",$Width,$height,-1,5,BitOR(0x00800000,0x80000000), BitOR(0x00000008,0x00000080))
  8.     GUISetBkColor($GuiBkColor,$guitooltip)
  9.     GUICtrlCreateLabel($text, $x, $y , $Width, $height)
  10.     GUICtrlSetFont(-1, 10, 700,0, "Tahoma")
  11.     GUICtrlSetColor(-1,$textColor)
  12.     GUISetState(@SW_SHOW)
  13.     Sleep($timeout&"000")
  14.     GUIDelete($guitooltip)
  15. EndFunc
  16.  
  17. _GUIToolTip("Gui Tooltip Created By TrunghieuTH10",250,18,0xFFFFFF,0x0000FF,3)
  18. _GUIToolTip("TrunghieuTH10",250,18,0xFFFFFF,0x0000FF,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement