Что нового

как сделать дочернее окно программы

lexaSF

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

Код:
#Region
#AutoIt3Wrapper_Icon=C:\Users\Lexa\Desktop\im.ico
#AutoIt3Wrapper_Res_Icon_Add=C:\Users\Lexa\Desktop\zhek.ico
#EndRegion

#NoTrayIcon

#Include <GUIConstantsEx.au3>

$Form1_1 = GUICreate("AvtoStart Accounts", 253, 156, 694, 553)
$ListBox1_1 = GUICtrlCreateList("", 24, 16, 113, 97)
GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
$Button1_1 = GUICtrlCreateButton("&Add", 152, 15, 75, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button2_1 = GUICtrlCreateButton("&Edit", 152, 51, 75, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button3_1 = GUICtrlCreateButton("&Delete", 152, 89, 75, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button4_2 = GUICtrlCreateButton("&START!", 85, 125, 75, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Group1_1 = GUICtrlCreateGroup("", 10, 0, 233, 121)
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1_1 = GUICtrlCreateLabel("Create ToSTeP", 183, 140, 70, 18)
GUICtrlSetFont(-1, 7, 800, 0, "Palatino Linotype")
$Label2_2 = GUICtrlCreateLabel("Zhyk.ru", 32, 141, 42, 20)
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Icon1_1 = GUICtrlCreateIcon(@ScriptFullPath, -5, 5, 128, 24, 24)
TraySetIcon(@ScriptFullPath, -5)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            GUIDelete($Form1_1)
            Exit
        Case $Button1_1
			ControlDisable('AvtoStart Accounts','',$Button1_1)
            Switch _ChoosenDlg($Form1_1)
                Case 0
                Case 1
					If $GUI = 1 Then ControlDisable('AvtoStart Accounts','',$Button1_1)
						_CreateSID($Form1_1)
					EndSwitch
				EndSwitch
						WEnd
Func _ChoosenDlg($hParent = 0)

    Local $Form2, $Button_2_1, $Button_2_2, $Group_2_2, $Label_2_1, $Radio_2_1, $Radio_2_2
    Local $Result = 0
	Global $GUI = 0

    GUISetState(@SW_DISABLE, $hParent)

    $Form2 = GUICreate("Choosen  Dialog", 230, 117, 272, 186, -1, -1, $hParent)
    $Group2_1 = GUICtrlCreateGroup("", 18, 16, 193, 65)
    GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
    $Radio2_1 = GUICtrlCreateRadio("Input on SID", 26, 32, 169, 17)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Radio2_2 = GUICtrlCreateRadio("Input on Login", 26, 56, 169, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Label2_1 = GUICtrlCreateLabel("Choose your type of start", 24, 0, 155, 22)
    GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
    $Button2_1 = GUICtrlCreateButton("Cancel", 123, 88, 89, 25, 0)
    GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
    $Button2_2 = GUICtrlCreateButton("OK", 16, 88, 89, 25, 0)
    GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
	WinMove('Choosen  Dialog','',720,575)
    GUISetState()

    While 1
        Switch GUIGetMsg()
		Case $GUI_EVENT_CLOSE, $Button2_1
			ControlEnable('AvtoStart Accounts','',$Button1_1)
                ExitLoop
            Case $Button2_2
				ControlEnable('AvtoStart Accounts','',$Button1_1)
                If GUICtrlRead($Radio2_1) = $GUI_CHECKED Then
                    $Result = 1
					$GUI = 1
                Else
                    $Result = 2
					$GUI = 1
                EndIf
                ExitLoop
        EndSwitch
    WEnd

    GUISetState(@SW_ENABLE, $hParent)
    GUIDelete($Form2)

    Return $Result
	Return $GUI
EndFunc   ;==>_ChoosenDlg

Func _CreateSID($hParent = 0)

	Local $Form3,$Label3_1,$Label3_2,$label3_3,$Label3_4,$Label3_5,$Label3_6,$Input3_1,$Input3_2,$Input3_3,$Input3_4,$Button3_1,$Button3_2,$Group3_1,$Combo3_1,$Combo3_2

	GUISetState(@SW_DISABLE,$hParent)

	$Form3 = GUICreate("Create Account (SID)", 201, 351, 792, 403, $hParent)
			GUISetIcon("C:\Users\Lexa\Desktop\im.ico")
$Label3_1 = GUICtrlCreateLabel("SID:", 16, 112, 35, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3_1 = GUICtrlCreateInput("", 16, 40, 169, 21)
$Label3_2 = GUICtrlCreateLabel("Name:", 16, 16, 50, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3_2 = GUICtrlCreateInput("", 16, 136, 169, 21)
$Label3_3 = GUICtrlCreateLabel("ID:", 16, 64, 23, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3_3 = GUICtrlCreateInput("", 16, 88, 169, 21)
$Label3_4 = GUICtrlCreateLabel("Server:", 16, 160, 56, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Input3_4 = GUICtrlCreateInput("", 16, 184, 169, 21)
$Button3_1 = GUICtrlCreateButton("Save", 16, 312, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Button3_2 = GUICtrlCreateButton("Cancel", 112, 312, 73, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3_2 = GUICtrlCreateCombo("None", 16, 232, 169, 25)
GUICtrlSetData(-1, "1-1|1-2|1-3|1-4|1-5|1-6|1-7|1-8|2-1|2-2|2-3|2-4|2-5|2-6|2-7|2-8|3-1|3-2|3-3|3-4|3-5|3-6|3-7|3-8|4-1|4-2|4-3|4-5")
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
$Label3_6 = GUICtrlCreateLabel("Map:", 16, 208, 36, 22)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Group3_1 = GUICtrlCreateGroup("", 8, 0, 185, 345)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label3_5 = GUICtrlCreateLabel("Setting File:", 16, 256, 74, 24)
GUICtrlSetFont(-1, 10, 800, 0, "Palatino Linotype")
$Combo3_1 = GUICtrlCreateCombo("None", 16, 280, 169, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Palatino Linotype")
WinMove('Create Account (SID)','',985,455)
GUISetState()

While 1
	ControlDisable('AvtoStart Accounts','',$Button1_1)
	Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
					ControlEnable('AvtoStart Accounts','',$Button1_1)
					ExitLoop
				Case $Button3_1
					ControlEnable('AvtoStart Accounts','',$Button1_1)
				Case $Button3_2
					ControlEnable('AvtoStart Accounts','',$Button1_1)
            EndSwitch
		WEnd

	GUISetState(@SW_ENABLE, $hParent)
    GUIDelete($Form3)

	EndFunc
 

kaster

Мой Аватар, он лучший самый
Команда форума
Глобальный модератор
Сообщения
4,020
Репутация
626
Re: дочернее окно

Предупреждение За нарушение правил форума (пункт Б.5):
Имя темы должно нести смысловую нагрузку (отражать суть вопроса/проблемы)
Правильно сформулированное название темы привлекает больше внимания, и шансы получить конкретный ответ увеличиваются.


Как правильно называть темы

"дочернее окно" - это неприемлемое название темы, переименуйте тему иначе она будет закрыта, а вам возможно будет выдан бан на несколько дней.

С уважением, Модератор раздела.
 

Viktor217

Осваивающий
Сообщения
233
Репутация
31
lexaSF, прочитал как правильно называть темы?)
Я бы назвал так: "Присвоение окну статуса "дочернее""(=
 

Yashied

Модератор
Команда форума
Глобальный модератор
Сообщения
5,379
Репутация
2,724
lexaSF

Видит Бог, это было последнее предупреждение.

:ninja:
 

kzru_hunter

Осваивающий
Сообщения
144
Репутация
49
lexaSF, посмотри внимательно, как ты создал окно при вызове GuiCreate и увидишь ошибку.
 
Автор
L

lexaSF

Новичок
Сообщения
182
Репутация
3
Yashied сказал(а):
lexaSF

Видит Бог, это было последнее предупреждение.

:ninja:
ну что опять не так :smile: я изменил название темы, и ошибку уже нашел.Спасибо
 

CreatoR

Must AutoIt!
Команда форума
Администратор
Сообщения
8,671
Репутация
2,481
lexaSF [?]
что опять не так
То что ты создал тему с неправильным заголовком, в какой раз. Модераторы не должны тебе выдавать подобные предупреждения каждый раз при созданий тобой новой темы.

ошибку уже нашел
Значит данная тема бесполезна?
 
Верх