Ahmed97 Posted June 1, 2011 Share Posted June 1, 2011 Hii, Why The Slider max is in down not in the up. if i want get slider to max .e.g limit max is 100 and min limit is 0 why ? No. 100 is under, and it is not above And the 0 is above not in under ? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 1, 2011 Share Posted June 1, 2011 If you want it to work the other way around, instead of taking the value returned by reading the control, do something like this: $return = 100 - guictrlread($slider) If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 can u make an example please ? i dont understand ^^ Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 (edited) $Form2 = GUICreate("Trans Window", 116, 317, 403, 214) $Group22 = GUICtrlCreateGroup("Transperancy", 16, 0, 89, 313) $slider = GUICtrlCreateSlider(40, 16, 43, 269, BitOR($TBS_VERT, $TBS_AUTOTICKS, $TBS_BOTH)) GUICtrlSetLimit(-1, 255, 65) GUICtrlSetData(1, 255) $Label = GUICtrlCreateLabel("255", 34, 288, 52, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $Prev = GUICtrlRead($slider) While 1 $Data = 100 - GUICtrlRead($slider);;;;;;;;; Here ;;;;;;;;;; If $Data <> $Prev Then GUICtrlSetData($Label, $Data) If $Data < 256 Then WinSetTrans($Directory, "", $Data) If $Data > 65 Then WinSetTrans($Directory, "", $Data) $Prev = $Data EndIf EndIf EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop EndSwitch WEnd i reaplaced ur code with this ;; but dont working $Data = GuiCtrlRead($Slider) Edited June 1, 2011 by TheMaster Link to comment Share on other sites More sharing options...
pieeater Posted June 1, 2011 Share Posted June 1, 2011 i think OP is asking why the slider is at the bottem rather than the top of the slider. and im not sure how to fix that. you'd have to invert the slider somehow [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
BrewManNH Posted June 1, 2011 Share Posted June 1, 2011 Try this: #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> $Form2 = GUICreate("Trans Window", 116, 317, 403, 214) $Group22 = GUICtrlCreateGroup("Transperancy", 16, 0, 89, 313) $slider = GUICtrlCreateSlider(40, 16, 43, 269, BitOR($TBS_VERT, $TBS_AUTOTICKS, $TBS_BOTH)) GUICtrlSetLimit(-1, 255, 0) ;~ GUICtrlSetData(1, 255) $Label = GUICtrlCreateLabel("255", 34, 288, 52, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $Prev = GUICtrlRead($slider) While 1 $Data = 255 - GUICtrlRead($slider);;;;;;;;; Here ;;;;;;;;;; If $Data <> $Prev Then GUICtrlSetData($Label, $Data) If $Data < 256 And $Data > 65 Then WinSetTrans($Form2, "", $Data) ;~ If $Data > 65 Then ;~ WinSetTrans($Form2, "", $Data) $Prev = $Data ;~ EndIf EndIf EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop EndSwitch WEnd If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 Try this: #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> $Form2 = GUICreate("Trans Window", 116, 317, 403, 214) $Group22 = GUICtrlCreateGroup("Transperancy", 16, 0, 89, 313) $slider = GUICtrlCreateSlider(40, 16, 43, 269, BitOR($TBS_VERT, $TBS_AUTOTICKS, $TBS_BOTH)) GUICtrlSetLimit(-1, 255, 0) ;~ GUICtrlSetData(1, 255) $Label = GUICtrlCreateLabel("255", 34, 288, 52, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $Prev = GUICtrlRead($slider) While 1 $Data = 255 - GUICtrlRead($slider);;;;;;;;; Here ;;;;;;;;;; If $Data <> $Prev Then GUICtrlSetData($Label, $Data) If $Data < 256 And $Data > 65 Then WinSetTrans($Form2, "", $Data) ;~ If $Data > 65 Then ;~ WinSetTrans($Form2, "", $Data) $Prev = $Data ;~ EndIf EndIf EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop EndSwitch WEnd Awesome it's working Thnxx Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 i think OP is asking why the slider is at the bottem rather than the top of the slider. and im not sure how to fix that. you'd have to invert the slider somehowhe did it Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 (edited) there's mini problem #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> $Form2 = GUICreate("Trans Window", 116, 317, 403, 214) $Group22 = GUICtrlCreateGroup("Transperancy", 16, 0, 89, 313) $slider = GUICtrlCreateSlider(40, 16, 43, 269, BitOR($TBS_VERT, $TBS_AUTOTICKS, $TBS_BOTH)) GUICtrlSetLimit(-1, 255, 50) ;;;;;;;;;;;; Here ;;;;;;;;;;; $Label = GUICtrlCreateLabel("255", 34, 288, 52, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $Prev = GUICtrlRead($slider) While 1 $Data = 255 - GUICtrlRead($slider) If $Data <> $Prev Then GUICtrlSetData($Label, $Data) If $Data < 256 And $Data > 0 Then WinSetTrans($Form2, "", $Data) $Prev = $Data EndIf EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop EndSwitch WEnd There ;;;;; i want set min limit is 50 but it's descrase from the max limit 50 what should i do ? Edited June 1, 2011 by TheMaster Link to comment Share on other sites More sharing options...
BrewManNH Posted June 1, 2011 Share Posted June 1, 2011 (edited) If you see how I set it in my example, I didn't use the limits in GUICtrlSetLimit I adjusted the minimum setting using the If comparison. You'd need to change this line If $Data < 256 And $Data > 0 Then To this If $Data < 256 And $Data > 50 Then And delete the GUICtrlSetLimit line completely. EDIT: Just wanted to make it clear that even though the slider value may go under 50, the transparency never will, with that change to the line above. Edited June 1, 2011 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 (edited) ok thnx But the problem is in the label... wrong reading from label i think min is 155, its must be 50 !! Here's the code #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> $Form2 = GUICreate("Trans Window", 116, 317, 403, 214) $Group22 = GUICtrlCreateGroup("Transperancy", 16, 0, 89, 313) $slider = GUICtrlCreateSlider(40, 16, 43, 269, BitOR($TBS_VERT, $TBS_AUTOTICKS, $TBS_BOTH)) $Label = GUICtrlCreateLabel("255", 34, 288, 52, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $Prev = GUICtrlRead($slider) While 1 $Data = 255 - GUICtrlRead($slider) If $Data <> $Prev Then GUICtrlSetData($Label, $Data) If $Data < 256 And $Data > 50 Then WinSetTrans($Form2, "", $Data) $Prev = $Data EndIf EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) ExitLoop EndSwitch WEnd Edited June 1, 2011 by TheMaster Link to comment Share on other sites More sharing options...
BrewManNH Posted June 1, 2011 Share Posted June 1, 2011 Sorry about that, I completely mislead you by mistake when I told you to delete the GUICtrlSetLimit line. What needs to be there instead of what you had for the limits is the correct code below. I was reading what you were looking to do incorrectly, and now this should be more towards what you're looking for. #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> $Form2 = GUICreate("Trans Window", 116, 317, 403, 214) $Group22 = GUICtrlCreateGroup("Transperancy", 16, 0, 89, 313) $slider = GUICtrlCreateSlider(40, 16, 43, 269, BitOR($TBS_VERT, $TBS_AUTOTICKS, $TBS_BOTH)) GUICtrlSetLimit(-1, 255, 50) $Label = GUICtrlCreateLabel("255", 34, 288, 52, 17, $SS_CENTER) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $Prev = GUICtrlRead($slider) While 1 $Data = 305 - GUICtrlRead($slider) If $Data <> $Prev Then If $Data < 256 Then WinSetTrans($Form2, "", $Data) GUICtrlSetData($Label, $Data) $Prev = $Data EndIf EndIf $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE GUIDelete($Form2) Exit EndSwitch WEnd If there's any questions, please feel free to ask. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Ahmed97 Posted June 1, 2011 Author Share Posted June 1, 2011 Thank you for your trouble with me, it's working 100% Link to comment Share on other sites More sharing options...
BrewManNH Posted June 1, 2011 Share Posted June 1, 2011 I'm sorry it took me so many tries to get it right, I can only blame it on being up far too late and trying to write scripts at the same time. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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