darzanmihai Posted January 21, 2009 Share Posted January 21, 2009 How could I create initially hiden controls? I do not need to create the control and then make it hiden, I need it to be created hiden already. How could I do this? Thx in advance. I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
Bert Posted January 21, 2009 Share Posted January 21, 2009 You set the state of the control after you make it, but BEFORE you show the GUI. Example: $button1 = GUICtrlCreateButton("button", 3, 3, 20, 20) GUICtrlSetState($button1, $GUI_HIDE) GUISetState() The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
darzanmihai Posted January 21, 2009 Author Share Posted January 21, 2009 You set the state of the control after you make it, but BEFORE you show the GUI. Example: $button1 = GUICtrlCreateButton("button", 3, 3, 20, 20) GUICtrlSetState($button1, $GUI_HIDE) GUISetState() I know what you say, but I need this control created after the gui was shown, so I need it to be already hiden. I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
Bert Posted January 21, 2009 Share Posted January 21, 2009 Is this a GUI you are making? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
KaFu Posted January 21, 2009 Share Posted January 21, 2009 I know what you say, but I need this control created after the gui was shown, so I need it to be already hiden.Create and destroy them in runtime, look up GUICtrlDelete()... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
darzanmihai Posted January 21, 2009 Author Share Posted January 21, 2009 Create and destroy them in runtime, look up GUICtrlDelete()...I do not need it to be deleted, I only need the control to be hiden in the moment I create it.The script I have, creates controls and then when I push a button, it deletes the existing controls (Guictrldelete) and creates other controls, but some of those I need them to be hiden already. If I hide them after creating them, they can bee seen for a flash of a seccond and it is not cool.Thx for replay I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
darzanmihai Posted January 21, 2009 Author Share Posted January 21, 2009 Is this a GUI you are making?Yes, I am making a GUI Thx for replay I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
Bert Posted January 21, 2009 Share Posted January 21, 2009 Here is what you do. Make the control beforehand, but hide it first and also have it located off the screen. Have it as a dummy control so to speak. You can use GUICtrlSetPos to move the control into position you need, then use GUICtrlSetData to set the text of the control. Once you do this, you can show it if needed. That way you won't get the flicker. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
darzanmihai Posted January 21, 2009 Author Share Posted January 21, 2009 Here is what you do. Make the control beforehand, but hide it first and also have it located off the screen. Have it as a dummy control so to speak. You can use GUICtrlSetPos to move the control into position you need, then use GUICtrlSetData to set the text of the control. Once you do this, you can show it if needed. That way you won't get the flicker.Why didn't think of that?Thank you very much! I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
darzanmihai Posted January 21, 2009 Author Share Posted January 21, 2009 Why didn't think of that? Thank you very much! Whell....my gui has got a picture as background, and by doing as you suggested, I will still get the flicker. This is an example script to demonstrate that flicker: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #Region ### START Koda GUI section ### Form= $GuiWidth = 633 $GuiHeight = 447 $Form1 = GUICreate("Form1",$GuiWidth ,$GuiHeight , -1, -1) $Pic2 = GUICtrlCreatePic(@WindowsDir & "\ServicePackFiles\i386\Sample1.jpg", 0, 0, $GuiWidth, $guiHeight, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateInput("", $GuiWidth +10, $GuiHeight+10,100,23) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $inp = GUICtrlCreateInput("", $GuiWidth +10, $GuiHeight+10,100,23) GUICtrlSetState(-1,$GUI_HIDE) Local $w=0,$h=0 , $i=0 While 1 GUICtrlSetPos($inp,$w,$h) $w+=5 If $w> $GuiWidth+10 Then $w=0 $h+=5 EndIf If $w>$GuiWidth and $h>$GuiHeight Then Exit $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
KaFu Posted January 21, 2009 Share Posted January 21, 2009 as i said...Create and destroy them in runtime...if needed, save values to variables and set them with GuiCtrlSetData() instantly after creation... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
KaFu Posted January 21, 2009 Share Posted January 21, 2009 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $GuiWidth = 633 $GuiHeight = 447 $Form1 = GUICreate("Form1",$GuiWidth ,$GuiHeight , -1, -1) $Pic2 = GUICtrlCreatePic(@WindowsDir & "\ServicePackFiles\i386\Sample1.jpg", 0, 0, $GuiWidth, $guiHeight, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $button = GUICtrlCreateButton("Show Input",20,200) GUISetState(@SW_SHOW) $inp_value = "TestValue" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button if GUICtrlRead($button) = "Show Input" Then $inp = GUICtrlCreateInput("", 10, 10,100,23) GUICtrlSetData(-1,$inp_value) GUICtrlSetData($button,"Hide Input") Else GUICtrlSetData($button,"Show Input") GUICtrlDelete($inp) EndIf EndSwitch WEnd OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
darzanmihai Posted January 22, 2009 Author Share Posted January 22, 2009 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> $GuiWidth = 633 $GuiHeight = 447 $Form1 = GUICreate("Form1",$GuiWidth ,$GuiHeight , -1, -1) $Pic2 = GUICtrlCreatePic(@WindowsDir & "\ServicePackFiles\i386\Sample1.jpg", 0, 0, $GuiWidth, $guiHeight, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) $button = GUICtrlCreateButton("Show Input",20,200) GUISetState(@SW_SHOW) $inp_value = "TestValue" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button if GUICtrlRead($button) = "Show Input" Then $inp = GUICtrlCreateInput("", 10, 10,100,23) GUICtrlSetData(-1,$inp_value) GUICtrlSetData($button,"Hide Input") Else GUICtrlSetData($button,"Show Input") GUICtrlDelete($inp) EndIf EndSwitch WEnd I agree with your solution, but if I use it I will have to modify a very large amount of my code, so I need another way to do this... I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
darzanmihai Posted January 22, 2009 Author Share Posted January 22, 2009 I agree with your solution, but if I use it I will have to modify a very large amount of my code, so I need another way to do this...Does anybody have other ideeas? I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
ResNullius Posted January 22, 2009 Share Posted January 22, 2009 Does anybody have other ideeas?In the example you posted #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #Region ### START Koda GUI section ### Form= $GuiWidth = 633 $GuiHeight = 447 $Form1 = GUICreate("Form1",$GuiWidth ,$GuiHeight , -1, -1) $Pic2 = GUICtrlCreatePic(@WindowsDir & "\ServicePackFiles\i386\Sample1.jpg", 0, 0, $GuiWidth, $guiHeight, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateInput("", $GuiWidth +10, $GuiHeight+10,100,23) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $inp = GUICtrlCreateInput("", $GuiWidth +10, $GuiHeight+10,100,23) GUICtrlSetState(-1,$GUI_HIDE) Local $w=0,$h=0 , $i=0 While 1 GUICtrlSetPos($inp,$w,$h) $w+=5 If $w> $GuiWidth+10 Then $w=0 $h+=5 EndIf If $w>$GuiWidth and $h>$GuiHeight Then Exit $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndyou are constantly moving the control. Is this what you're doing in your "real" script? Perhaps if you can outline the end result you're trying to accomplish, we can offer other ideas. Link to comment Share on other sites More sharing options...
darzanmihai Posted January 23, 2009 Author Share Posted January 23, 2009 In the example you posted you are constantly moving the control. Is this what you're doing in your "real" script?Perhaps if you can outline the end result you're trying to accomplish, we can offer other ideas.In my original script I have to hiddenly move about 100 controls, each control is moved only one time, but the example I made was to reproduce the efect of moving all those controls. I do not like stupid and idiot people that write idiot things...If you are one, do not write. Link to comment Share on other sites More sharing options...
ResNullius Posted January 24, 2009 Share Posted January 24, 2009 In my original script I have to hiddenly move about 100 controls, each control is moved only one time, but the example I made was to reproduce the efect of moving all those controls.Volly almost had it right the first time, but instead of hiding the control after it's created which creates the flash, hide it WHEN it's created: $button1 = GUICtrlCreateButton("button", 3, 3, 20, 20,$GUI_HIDE) That way you create it where you want it, don't have to move it, and you have no flash when creating it. Then if you have to show it later on do a GUICtrlSetState($button1,$GUI_SHOW) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now