PDA

Показать полную графическую версию : [решено] как поменять цвет фона в GUICtrlCreateTab


Centrinar
14-05-2010, 22:34
$Tab = GUICtrlCreateTab(10, 10,300, 300)
GUISetBkColor(0x8491a4) - не работает, как оно меняеться?

Creat0R
14-05-2010, 23:32
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <GUIConstantsEx.au3>
#include (http://www.autoitscript.com/autoit3/docs/keywords.htm##include) <GUITab.au3>

$Gui = GUICreate (http://www.autoitscript.com/autoit3/docs/functions/GUICreate.htm)("_GUICtrlTab_SetBkColor() Demo", 320, 280)

$hTab = GUICtrlCreateTab (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateTab.htm)(10, 20, 300, 250)

GUICtrlCreateTabItem (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateTabItem.htm)("Tab 1")
_GUICtrlTab_SetBkColor($Gui, $hTab, 0xFF0000)

GUICtrlCreateButton (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateButton.htm)("Some Button", 20, 50)

GUICtrlCreateTabItem (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateTabItem.htm)("Tab 2")
_GUICtrlTab_SetBkColor($Gui, $hTab, 0x00CC00)

GUICtrlCreateCheckbox (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateCheckbox.htm)("Some Checkbox", 20, 50)

GUISetState (http://www.autoitscript.com/autoit3/docs/functions/GUISetState.htm)()

While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
$Msg = GUIGetMsg (http://www.autoitscript.com/autoit3/docs/functions/GUIGetMsg.htm)()
Switch (http://www.autoitscript.com/autoit3/docs/keywords.htm#Switch) $Msg
Case (http://www.autoitscript.com/autoit3/docs/keywords.htm#Case) $GUI_EVENT_CLOSE
Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)
EndSwitch (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndSwitch)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $aTabPos = ControlGetPos (http://www.autoitscript.com/autoit3/docs/functions/ControlGetPos.htm)($hWnd, "", $hSysTab32)

Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $aTab_Rect = _GUICtrlTab_GetItemRect (http://dundats.mvps.org/help/html/libfunctions/_guictrltab_getitemrect.htm)($hSysTab32, -1)

GUICtrlCreateLabel (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlCreateLabel.htm)("", $aTabPos[0]+2, $aTabPos[1]+$aTab_Rect[3]+4, $aTabPos[2]-4, $aTabPos[3]-$aTab_Rect[3]-7)
GUICtrlSetBkColor (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetBkColor.htm)(-1, $sBkColor)
GUICtrlSetState (http://www.autoitscript.com/autoit3/docs/functions/GUICtrlSetState.htm)(-1, $GUI_DISABLE)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc)



И ещё по теме: Решение проблемы цвета для элементов на Tab'ах (http://autoit-script.ru/index.php?topic=402.0)




© OSzone.net 2001-2012