Что нового

Как указать цвет группы

lexaSF

Новичок
Сообщения
182
Репутация
3
Здравствуйте, подскажите как указать цвет группы (самой рамочки), а то я меняю цвет а он меняется во всех элементах группы
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Это называется GroupBox или элемент "Группа", но никак не просто группа. А для полной ясности, покажи как и где ты меняешь цвет.
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
вот где я показал стрелкой там меняет цвет фона надписей, а там где кружочком вообще ничего не делает
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Ты сам код покажи, который получается при генерации GUI. И название темы поправь.
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
Код:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\users\lexa\desktop\newprogakklogin.kxf
$Form1_1 = GUICreate("Form1", 218, 319, 792, 463)
GUISetBkColor(0x333333)
$Group1 = GUICtrlCreateGroup("", 8, 0, 201, 305)
GUICtrlSetColor(-1, 0x808000)
$Label1 = GUICtrlCreateLabel("Уридиум:", 16, 200, 71, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label2 = GUICtrlCreateLabel("334", 88, 200, 31, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label3 = GUICtrlCreateLabel("Кредиты:", 16, 232, 71, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label4 = GUICtrlCreateLabel("Опыт:", 16, 40, 45, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label5 = GUICtrlCreateLabel("Уровень:", 16, 8, 70, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label6 = GUICtrlCreateLabel("111", 88, 232, 31, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label7 = GUICtrlCreateLabel("11", 88, 8, 22, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label10 = GUICtrlCreateLabel("Ранг:", 16, 72, 42, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label12 = GUICtrlCreateLabel("Премиум:", 16, 104, 76, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label11 = GUICtrlCreateLabel("Да", 98, 104, 23, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label13 = GUICtrlCreateLabel("Компания:", 16, 136, 84, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label14 = GUICtrlCreateLabel("VRU", 101, 136, 34, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0x00FF00)
$Label15 = GUICtrlCreateLabel("Игрок с:", 16, 168, 63, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label16 = GUICtrlCreateLabel("2009-03-", 78, 168, 66, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label17 = GUICtrlCreateLabel("3.3**.***", 62, 41, 75, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label18 = GUICtrlCreateLabel("ДжекПот:", 16, 264, 71, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label19 = GUICtrlCreateLabel("21312", 90, 264, 49, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Pic1 = GUICtrlCreatePic("C:\Games\IBot 2.74\img\rank\rank_1.gif", 64, 72, 13, 16, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
кстати когда я пытаюсь запуститьб форму с изображением вылазиет ошибка
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
lexaSF [?]
с изображением вылазиет ошибка
Вы константы используете, а файлы с ними в скрипт не включаете.
Группу можно нарисовать, например, так:
Код:
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

#region ### START Koda GUI section ### Form=c:\users\lexa\desktop\newprogakklogin.kxf
$Form1_1 = GUICreate("Form1", 218, 319)
GUISetBkColor(0x333333)

$Group1 = _GUICtrlCreateGroupEx("", 8, 5, 201, 302, 3, 0xDC143C, 1)

$Label1 = GUICtrlCreateLabel("Уридиум:", 16, 200, 71, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label2 = GUICtrlCreateLabel("334", 88, 200, 31, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label3 = GUICtrlCreateLabel("Кредиты:", 16, 232, 71, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label4 = GUICtrlCreateLabel("Опыт:", 16, 40, 45, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label5 = GUICtrlCreateLabel("Уровень:", 16, 8, 70, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label6 = GUICtrlCreateLabel("111", 88, 232, 31, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label7 = GUICtrlCreateLabel("11", 88, 8, 22, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label10 = GUICtrlCreateLabel("Ранг:", 16, 72, 42, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label12 = GUICtrlCreateLabel("Премиум:", 16, 104, 76, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label11 = GUICtrlCreateLabel("Да", 98, 104, 23, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label13 = GUICtrlCreateLabel("Компания:", 16, 136, 84, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label14 = GUICtrlCreateLabel("VRU", 101, 136, 34, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0x00FF00)
$Label15 = GUICtrlCreateLabel("Игрок с:", 16, 168, 63, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label16 = GUICtrlCreateLabel("2009-03-", 78, 168, 66, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label17 = GUICtrlCreateLabel("3.3**.***", 62, 41, 75, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Label18 = GUICtrlCreateLabel("ДжекПот:", 16, 264, 71, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xABABAB)
$Label19 = GUICtrlCreateLabel("21312", 90, 264, 49, 25)
GUICtrlSetFont(-1, 12, 400, 0, "Franklin Gothic Demi")
GUICtrlSetColor(-1, 0xE3E3E3)
$Pic1 = GUICtrlCreatePic("C:\Games\IBot 2.74\img\rank\rank_1.gif", 64, 72, 13, 16, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

	EndSwitch
WEnd

Func _GUICtrlCreateGroupEx($sText, $iLeft, $iTop, $iWidth, $iHeight, $iLineWidth = 3, $nColor = 0, $iStyle = 0, $sIcon = '', $nIconID = 0)
	Local $aIDs[2] ;First + Last IDs

	Local $nLabel_Style = $SS_ETCHEDFRAME

	;1 to able set color for the Group frame
	If $iStyle > 0 Then $nLabel_Style = $SS_SUNKEN

	GUIStartGroup()

	$aIDs[0] = GUICtrlCreateLabel('', $iLeft + 1, $iTop, $iWidth - 2, $iLineWidth, $nLabel_Style)
	GUICtrlSetBkColor(-1, $nColor)

	GUICtrlCreateLabel('', $iLeft + 2, $iTop + 5, $iLineWidth, $iHeight - 4, $nLabel_Style)
	GUICtrlSetBkColor(-1, $nColor)

	GUICtrlCreateLabel('', ($iLeft + $iWidth), $iTop - 3, $iLineWidth, $iHeight - 3, $nLabel_Style)
	GUICtrlSetBkColor(-1, $nColor)

	$aIDs[1] = GUICtrlCreateLabel('', $iLeft + 6, ($iTop + $iHeight) - 5, $iWidth, $iLineWidth, $nLabel_Style)
	GUICtrlSetBkColor(-1, $nColor)

	If $sText <> '' Then
		If $sIcon <> '' Then
			$iLeft += 15
			$sText = ' ' & $sText
		EndIf

		$aIDs[1] = GUICtrlCreateLabel('  ' & $sText, $iLeft + 35, $iTop - 6)
		GUICtrlSetColor(-1, $nColor)
	EndIf

	If $sIcon <> '' Then GUICtrlCreateIcon($sIcon, $nIconID, $iLeft + 25, $iTop - 8, 16, 16)

	Return $aIDs
EndFunc   ;==>_GUICtrlCreateGroupEx
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
вопрос не в том, как сдлеать группу, а в том как изменить цвет границы группы
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
Этот цвет связан с темой оформления, которая в данный момент у тебя установлена, и изменить его нельзя. Но ты можешь нарисовать собственный GroupBox (см. в сторону GUICtrlCreateGraphic...) или, еще проще, нарисовать непосредственно на картинке.
 
Верх