Ветеран
Сообщения: 812
Благодарности: 353
|
Профиль
|
Отправить PM
| Цитировать
Цитата -TRM-:
у меня видимо справка старая на русском языке, не могли бы Вы мне ссылочку дать ? »
|
Развитие русской справки
Можно примерно так сделать.
читать дальше »
Код: 
#include <GUIConstantsEx.au3>
Global $hGui, $i_Msg, $a_ChBx[6][2] = [[5],['Первый', 'Первая подсказка'],['Второй', 'Вторая подсказка'],['Третий', 'Третья подсказка'], _
['Четвертый', 'Четвертая подсказка'],['Пятый', 'Пятая подсказка']], $a_Check[2] = [@LF & '(Не отмечен)', @LF & '(Отмечен)']
$hGui = GUICreate('Test', 200, $a_ChBx[0][0] * 30 + 30)
For $i = 1 To $a_ChBx[0][0]
$a_ChBx[$i][0] = GUICtrlCreateCheckbox($a_ChBx[$i][0], 20, 20 + ($i - 1) * 30, 100, 20)
GUICtrlSetBkColor(-1, 0xFFFFFF)
Next
GUISetState()
While 1
$i_Msg = GUIGetMsg()
Switch $i_Msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $a_ChBx[1][0]
ConsoleWrite(_ToolTipControl($a_ChBx[1][0], $a_ChBx[1][1] & $a_Check[GUICtrlSendMsg($a_ChBx[1][0], 0xF0, 0, 0)], 'My Title', 1, 1, 5000) & @LF)
Case $a_ChBx[2][0] To $a_ChBx[$a_ChBx[0][0]][0]
For $i = 2 To $a_ChBx[0][0]
If $i_Msg = $a_ChBx[$i][0] Then
ConsoleWrite(_ToolTipControl($a_ChBx[$i][0], $a_ChBx[$i][1] & $a_Check[GUICtrlSendMsg($a_ChBx[$i][0], 0xF0, 0, 0)]) & @LF);$BM_GETCHECK = 0xF0
ExitLoop
EndIf
Next
EndSwitch
WEnd
_KillTT()
Exit
Func _ToolTipControl($i_ID, $s_Text, $s_Title = '', $i_Icon = 0, $i_Right = 0, $i_Time = 3000)
Local $h_ID, $t_Rect, $p_Rect, $a_Res, $i_X, $i_Y, $i_Ret
$h_ID = GUICtrlGetHandle($i_ID)
If Not $h_ID Then Return 0
$t_Rect = DllStructCreate('long[4]')
$p_Rect = DllStructGetPtr($t_Rect)
$a_Res = DllCall('user32.dll', 'int', 'GetWindowRect', 'hwnd', $h_ID, 'ptr', $p_Rect);_WinAPI_GetWindowRect()
If (@error) Or (Not $a_Res[0]) Then Return 0
If $i_Right Then
$i_X = DllStructGetData($t_Rect, 1, 3)
Else
$i_X = DllStructGetData($t_Rect, 1, 1)
EndIf
$i_Y = DllStructGetData($t_Rect, 1, 4)
$i_Ret = ToolTip($s_Text, $i_X, $i_Y, $s_Title, $i_Icon)
If $i_Ret Then
AdlibUnRegister('_KillTT')
AdlibRegister('_KillTT', $i_Time)
EndIf
Return $i_Ret
EndFunc ;==>_ToolTipControl
Func _KillTT()
AdlibUnRegister('_KillTT')
ToolTip('')
EndFunc ;==>_KillTT
|