Добрый день.
Подскажите , к примеру, если есть строка в EXSEl от родительского окна, то как нарисовать квадрат в дочернем окне? т.е. Как выполнить условие в дочернем окне?
Подскажите , к примеру, если есть строка в EXSEl от родительского окна, то как нарисовать квадрат в дочернем окне? т.е. Как выполнить условие в дочернем окне?
Код:
#include <WindowsConstants.au3>
#include <Array.au3>
#include <Excel.au3>
#include <GuiComboBox.au3>
#include <GuiButton.au3>
#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <MsgBoxConstants.au3>
#include <String.au3>
Global $gui, $guiPos, $pic, $picPos, $sText,$a, $b
#Region ### START Koda GUI section ### Form=
Local $hCombo
$hMain_GUI = GUICreate("Что нибудь да получится", 1193, 675, 102, 4)
GUISetBkColor(0xA3B2FE)
$tab = GUICtrlCreateTab(10, 80, 680, 580)
GUICtrlCreateTabItem("Соки")
$Label5 = GUICtrlCreateLabel("Магазин", 50, 120, 103, 21)
$Label6 = GUICtrlCreateLabel("Склад", 204, 120, 103, 21)
$Input3 = GUICtrlCreateInput("2500", 122, 115, 63, 21)
$Input4 = GUICtrlCreateInput("1800", 282, 115, 63, 21)
GUICtrlCreateTabItem("Воды")
GUISetState(@SW_SHOW, $hMain_GUI)
$Button1 = GUICtrlCreateButton("ПРОСМОТР", 764, 580, 105, 25)
$nSttngs_Button = GUICtrlCreateButton('ПРОВЕРКА', 764, 620, 105, 25)
#EndRegion ### END Koda GUI section ###y
While 2
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Local $oAppl = _Excel_Open()
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
Local $oWorkbook = _Excel_BookNew($oAppl)
If @error Then
MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example", "Error creating the new workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
_Excel_Close($oAppl)
Exit
EndIf
$oWorkbook.Columns('A:F' ).EntireColumn.Select ;колонки A-F
$oWorkbook.Selection.EntireColumn.AutoFit
$oWorkbook.Range('A1' ).Select
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, GUICtrlRead($Input3),'A1' )
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet ,GUICtrlRead($Input3)*(GUICtrlRead($Input4)-10),'B1' )
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet ,10,'C1' )
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet ,'квадрат','D1' )
Local $aResult002 = _Excel_RangeRead($oWorkbook, 1, "A1:D1", 1)
If $aResult002 > 0 then
$a;;;;;;;;; Как отсюда '$a'послать в дочерннее окно
else
GUICtrlSetData('','Не отмечен')
EndIf
Case $nSttngs_Button
_Settings_Dlg($hMain_GUI)
EndSwitch
WEnd
Func _Settings_Dlg($hParent = 0)
Local $hSettings, $iGOEM_Opt, $n, $msg
$iGOEM_Opt = Opt("GUIOnEventMode", 0)
$hSettings_GUI2=GUICreate("ПРОВЕРКА", 690, 400, 660, 400, $WS_SIZEBOX + $WS_SYSMENU, -1, $hParent) ; Создаёт окно в центре экрана
$a = GUICtrlCreateGraphic(20, 50, 100, 100, 0)
GUICtrlSetBkColor(-1, 0xf08000)
GUICtrlSetColor(-1, 0xff)
GUISetState(@SW_DISABLE, $hParent)
GUISetState(@SW_SHOW, $hSettings_GUI2)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Opt("GUIOnEventMode", $iGOEM_Opt)
GUISetState(@SW_ENABLE, $hParent)
GUIDelete($hSettings_GUI2)
EndFunc