Что нового

Обновление элементов [Gui]

Isn

Новичок
Сообщения
119
Репутация
2
Доброго времени суток
Написал код, подскажите как обновить [gui] в моем примере, у меня получается что если значения KConfig.ini меняются на False тот прорисовывается [GUICtrlCreatePic] нового значения и старого. Как мне от этого избавится, что б прорисовывалось только новое значение, а старое очищалось.
И второе с чем я столкнулся не срабатывают Case.
*.ini файлы и остальное во вложениях.

Код:
;-------------------------------------------------------------------------------------------------------------------------------
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;-------------------------------------------------------------------------------------------------------------------------------
$sDir = @ScriptDir
$Form2 = GUICreate("Test", 540, 290)
;$sGuiJpg = GUICtrlCreatePic($sDir & "\Data\Image.jpg", 0, 205, 540, 72)
$StatusBar1 = _GUICtrlStatusBar_Create($Form2)
$Button1 = GUICtrlCreateButton("Настройки", 264, 216, 91, 25, $WS_GROUP)
;-------------------------------------------------------------------------------------------------------------------------------
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Edit1 = GUICtrlCreateEdit("", 120, 264, 9, 1)
GUICtrlSetData(-1, "Edit1")
;---------------------------------------------------------
$Edit3 = GUICtrlCreateEdit("", 373, 245, 9, 1)
GUICtrlSetData(-1, "Edit1")
;-------------------------------------------------------------------------------------------------------------------------------
$Input1 = GUICtrlCreateInput("k7 192.168.0.17", 56, 130, 177, 21);6 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input1,$GUI_DISABLE)
;---------------------------------------------------------
$Input2 = GUICtrlCreateInput("k6 192.168.0.16", 56, 111, 177, 21);5 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input2,$GUI_DISABLE)
;---------------------------------------------------------
$Input3 = GUICtrlCreateInput("k5 192.168.0.15", 56, 88, 177, 21);4 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input3,$GUI_DISABLE)
;---------------------------------------------------------
$Input4 = GUICtrlCreateInput("k4 192.168.0.14", 56, 69, 177, 21);3 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input4,$GUI_DISABLE)
;---------------------------------------------------------
$Input5 = GUICtrlCreateInput("k9 192.168.0.19", 56, 168, 177, 21);8 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input5,$GUI_DISABLE)
;---------------------------------------------------------
$Input6 = GUICtrlCreateInput("k8 192.168.0.18", 56, 149, 177, 21);7 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input6,$GUI_DISABLE)
;---------------------------------------------------------
$Input7 = GUICtrlCreateInput("k11 192.168.0.21", 303, 52, 177, 21);10 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input7,$GUI_DISABLE)
;---------------------------------------------------------
$Input8 = GUICtrlCreateInput("k10 192.168.0.20", 303, 33, 177, 21);9 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input8,$GUI_DISABLE)
;---------------------------------------------------------
$Input9 = GUICtrlCreateInput("k3 192.168.0.13", 56, 50, 177, 21);2 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input9,$GUI_DISABLE)
;---------------------------------------------------------
$Input10 = GUICtrlCreateInput("k2 192.168.0.12", 56, 31, 177, 21);1 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input10,$GUI_DISABLE)
;---------------------------------------------------------
$Input11 = GUICtrlCreateInput("k13 192.168.0.23", 303, 90, 177, 21);12 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input11,$GUI_DISABLE)
;---------------------------------------------------------
$Input12 = GUICtrlCreateInput("k12 192.168.0.22", 303, 71, 177, 21);11 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input12,$GUI_DISABLE)
;---------------------------------------------------------
$Input13 = GUICtrlCreateInput("k15 192.168.0.25", 303, 132, 177, 21);14 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input13,$GUI_DISABLE)
;---------------------------------------------------------
$Input14 = GUICtrlCreateInput("k14 192.168.0.24", 303, 113, 177, 21);13 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input14,$GUI_DISABLE)
;---------------------------------------------------------
$Input15 = GUICtrlCreateInput("k17 192.168.0.27", 303, 170, 177, 21);16 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input15,$GUI_DISABLE)
;---------------------------------------------------------
$Input16 = GUICtrlCreateInput("k16 192.168.0.26", 303, 151, 177, 21);15 в списке
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetState($Input16,$GUI_DISABLE)
;-------------------------------------------------------------------------------------------------------------------------------
$sDir = @ScriptDir
;-------------------------------------------------------------------------------------------------------------------------------
$Pic1 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 114, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));5 в списке
$Pic2 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 88, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));4 в списке
$Pic3 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 68, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));3 в списке
;-------------------------------------------------------------------------------------------------------------------------------
$Pic13 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 29, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));1 в списке
$Pic14 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 173, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));8 в списке
$Pic15 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 153, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));7 в списке
$Pic16 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 132, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));6 в списке
$Pic17 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 47, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));2 в списке
$Pic18 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 31, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));9 в списке
$Pic19 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 90, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));12 в списке
$Pic20 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 70, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));11 в списке
$Pic21 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 49, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));10 в списке
$Pic22 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 116, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));13 в списке
$Pic23 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 175, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));16 в списке
$Pic24 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 155, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));15 в списке
$Pic25 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 134, 19, 19, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS));14 в списке
;-------------------------------------------------------------------------------------------------------------------------------
GUICtrlCreateGroup("", 16, 16, 513, 193)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton("Выход", 360, 216, 75, 25, $WS_GROUP)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
;-------------------------------------------------------------------------------------------------------------------------------
While 1
	_ReadPar()
	$nMsg = GUIGetMsg()
		Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit	
	Case $Button1
		MsgBox (4096, "Test", "Test")
	Case $Button3
		Exit
	EndSwitch
WEnd
;-------------------------------------------------------------------------------------------------------------------------------
Func _ReadPar()
	$sMServerView = @ScriptDir & '\KConfig.ini'
;-------------------------------------------------------------------------------	
	;Если параметр верен
	$sK2= IniRead ($sMServerView, "Setting", "K2", "")
	If $sK2 = '192.168.0.12True' Then
		$Pic13 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 29, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK3= IniRead ($sMServerView, "Setting", "K3", "")
	If $sK3 = '192.168.0.13True' Then
		$Pic17 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 47, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK4= IniRead ($sMServerView, "Setting", "K4", "")
	If $sK4 = '192.168.0.14True' Then
		$Pic3 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 68, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK5= IniRead ($sMServerView, "Setting", "K5", "")
	If $sK5 = '192.168.0.15True' Then
		$Pic2 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 88, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK6= IniRead ($sMServerView, "Setting", "K6", "")
	If $sK6 = '192.168.0.16True' Then
		$Pic1 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 114, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK7= IniRead ($sMServerView, "Setting", "K7", "")
	If $sK7 = '192.168.0.17True' Then
		$Pic16 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 132, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK8= IniRead ($sMServerView, "Setting", "K8", "")
	If $sK8 = '192.168.0.18True' Then
		$Pic15 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 153, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK9= IniRead ($sMServerView, "Setting", "K9", "")
	If $sK9 = '192.168.0.19True' Then
		$Pic14 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 33, 173, 19, 19)
	EndIf
;-------------------------------------------------------------------------------		
	$sK10= IniRead ($sMServerView, "Setting", "K10", "")
	If $sK10 = '192.168.0.20True' Then
		$Pic18 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 31, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK11= IniRead ($sMServerView, "Setting", "K11", "")
	If $sK11 = '192.168.0.21True' Then
		$Pic21 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 49, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK12= IniRead ($sMServerView, "Setting", "K12", "")
	If $sK12 = '192.168.0.22True' Then
		$Pic20 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 70, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK13= IniRead ($sMServerView, "Setting", "K13", "")
	If $sK13 = '192.168.0.23True' Then
		$Pic19 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 90, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK14= IniRead ($sMServerView, "Setting", "K14", "")
	If $sK14 = '192.168.0.24True' Then
		$Pic22 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 116, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK15= IniRead ($sMServerView, "Setting", "K15", "")
	If $sK15 = '192.168.0.25True' Then
		$Pic25 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 134, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK16= IniRead ($sMServerView, "Setting", "K16", "")
	If $sK16 = '192.168.0.26True' Then
		$Pic18 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 31, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK17= IniRead ($sMServerView, "Setting", "K17", "")
	If $sK16 = '192.168.0.27True' Then
		$Pic23 = GUICtrlCreatePic($sDir & "\Data\101.jpg", 280, 175, 19, 19)
	EndIf
;-------------------------------------------------------------------------------------------------------------------------------
	;Если параметр не верен
	$sK2= IniRead ($sMServerView, "Setting", "K2", "")
	If $sK2 = '192.168.0.12False' Then
		$Pic13 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 29, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK3= IniRead ($sMServerView, "Setting", "K3", "")
	If $sK3 = '192.168.0.13False' Then
		$Pic17 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 47, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK4= IniRead ($sMServerView, "Setting", "K4", "")
	If $sK4 = '192.168.0.14False' Then
		$Pic3 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 68, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK5= IniRead ($sMServerView, "Setting", "K5", "")
	If $sK5 = '192.168.0.15False' Then
		$Pic2 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 88, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK6= IniRead ($sMServerView, "Setting", "K6", "")
	If $sK6 = '192.168.0.16False' Then
		$Pic1 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 114, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK7= IniRead ($sMServerView, "Setting", "K7", "")
	If $sK7 = '192.168.0.17False' Then
		$Pic16 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 132, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK8= IniRead ($sMServerView, "Setting", "K8", "")
	If $sK8 = '192.168.0.18False' Then
		$Pic15 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 153, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK9= IniRead ($sMServerView, "Setting", "K9", "")
	If $sK9 = '192.168.0.19False' Then
		$Pic14 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 33, 173, 19, 19)
	EndIf
;-------------------------------------------------------------------------------		
	$sK10= IniRead ($sMServerView, "Setting", "K10", "")
	If $sK10 = '192.168.0.20False' Then
		$Pic18 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 31, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK11= IniRead ($sMServerView, "Setting", "K11", "")
	If $sK11 = '192.168.0.21False' Then
		$Pic21 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 49, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK12= IniRead ($sMServerView, "Setting", "K12", "")
	If $sK12 = '192.168.0.22False' Then
		$Pic20 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 70, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK13= IniRead ($sMServerView, "Setting", "K13", "")
	If $sK13 = '192.168.0.23False' Then
		$Pic19 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 90, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK14= IniRead ($sMServerView, "Setting", "K14", "")
	If $sK14 = '192.168.0.24False' Then
		$Pic22 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 116, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK15= IniRead ($sMServerView, "Setting", "K15", "")
	If $sK15 = '192.168.0.25False' Then
		$Pic25 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 134, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK16= IniRead ($sMServerView, "Setting", "K16", "")
	If $sK16 = '192.168.0.26False' Then
		$Pic18 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 31, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK17= IniRead ($sMServerView, "Setting", "K17", "")
	If $sK16 = '192.168.0.27False' Then
		$Pic23 = GUICtrlCreatePic($sDir & "\Data\102.jpg", 280, 175, 19, 19)
	EndIf
;-------------------------------------------------------------------------------------------------------------------------------	
	;Если  не в сети
	$sK2= IniRead ($sMServerView, "Setting", "K2", "")
	If $sK2 = '' Then
		$Pic13 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 29, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK3= IniRead ($sMServerView, "Setting", "K3", "")
	If $sK3 = '' Then
		$Pic17 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 47, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK4= IniRead ($sMServerView, "Setting", "K4", "")
	If $sK4 = '' Then
		$Pic3 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 68, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK5= IniRead ($sMServerView, "Setting", "K5", "")
	If $sK5 = '' Then
		$Pic2 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 88, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK6= IniRead ($sMServerView, "Setting", "K6", "")
	If $sK6 = '' Then
		$Pic1 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 114, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK7= IniRead ($sMServerView, "Setting", "K7", "")
	If $sK7 = '' Then
		$Pic16 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 132, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK8= IniRead ($sMServerView, "Setting", "K8", "")
	If $sK8 = '' Then
		$Pic15 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 153, 19, 19)
	EndIf
;-------------------------------------------------------------------------------	
	$sK9= IniRead ($sMServerView, "Setting", "K9", "")
	If $sK9 = '' Then
		$Pic14 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 33, 173, 19, 19)
	EndIf
;-------------------------------------------------------------------------------		
	$sK10= IniRead ($sMServerView, "Setting", "K10", "")
	If $sK10 = '' Then
		$Pic18 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 31, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK11= IniRead ($sMServerView, "Setting", "K11", "")
	If $sK11 = '' Then
		$Pic21 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 49, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK12= IniRead ($sMServerView, "Setting", "K12", "")
	If $sK12 = '' Then
		$Pic20 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 70, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK13= IniRead ($sMServerView, "Setting", "K13", "")
	If $sK13 = '' Then
		$Pic19 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 90, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK14= IniRead ($sMServerView, "Setting", "K14", "")
	If $sK14 = '' Then
		$Pic22 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 116, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK15= IniRead ($sMServerView, "Setting", "K15", "")
	If $sK15 = '' Then
		$Pic25 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 134, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK16= IniRead ($sMServerView, "Setting", "K16", "")
	If $sK16 = '' Then
		$Pic18 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 31, 19, 19)
	EndIf
;-------------------------------------------------------------------------------
	$sK17= IniRead ($sMServerView, "Setting", "K17", "")
	If $sK16 = '' Then
		$Pic23 = GUICtrlCreatePic($sDir & "\Data\103.jpg", 280, 175, 19, 19)
	EndIf
;-------------------------------------------------------------------------------------------------------------------------------
	Sleep (250)
	GUISetState($Form2)
EndFunc
;-------------------------------------------------------------------------------------------------------------------------------
 

gregaz

AutoIT Гуру
Сообщения
1 166
Репутация
299
Нельзя поверх уже созданного GUICtrlCreatePic
создавать еще один, не сделав предыдущий (HIDE ).

А зачем каждый раз создавать новые.
Не проще ли перназначать новые рисунки в уже созданные.
Примерно так :
Код:
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

$hForm = GUICreate('Test',200, 300)
GUISetBkColor(0xECE9D8)

$hPic=GUICtrlCreatePic(@DocumentsCommonDir & "\Мои рисунки\Образцы рисунков\Закат.jpg", 10, 10, 180, 200)

$But=GUICtrlCreateButton("But", 10, 250, 40, 20)

GUISetState()

While 1
	$nMsg = GUIGetMsg()
	
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $But
			GUICtrlSetImage($hPic, @DocumentsCommonDir & "\Мои рисунки\Образцы рисунков\Зима.jpg")
		
	EndSwitch
WEnd
 
Автор
Isn

Isn

Новичок
Сообщения
119
Репутация
2
gregaz спс, то что нужно,), а что насчет case? У меня так и не получилось что б они срабатывали
 

madmasles

Модератор
Глобальный модератор
Сообщения
7 790
Репутация
2 319
Isn [?]
а что насчет case?
Уберите из функции эти строки
Код:
Sleep (250)
    GUISetState($Form2)

И, ИМХО, ее лучше вызывать через AdlibRegister().
 
Автор
Isn

Isn

Новичок
Сообщения
119
Репутация
2
Использовал AdlibRegister(), и почему я раньше это не использовал :scratch:
Спасибо madmasles :beer:
 
Верх