kjpolker Posted October 15, 2009 Share Posted October 15, 2009 (edited) Ok so I gave my GUI a slider bar and my first problem I ran into was that my GUI is a black window but I see the slider shows up as an ugly white box in the GUI, I tried changing the color but it didn't seem to do anything, my next problem was how I can read the slider value and make that the opacity, I mean if know how I would do it I just can't seem to figure out the actual wording for it. If someone can help me with these two problems I would appreciate it. This is the only user friendly idea that came to mind for opacity but maybe someone else likes a different way to do this they could share with me on changing opacity. Thanks! I assumed this would be a pretty common question but I couldn't find anything, not even with google. Edited October 15, 2009 by kjpolker Link to comment Share on other sites More sharing options...
BrettF Posted October 15, 2009 Share Posted October 15, 2009 Set the background colour of the control...? GUICtrlRead WinSetTrans Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
kjpolker Posted October 15, 2009 Author Share Posted October 15, 2009 (edited) Yeah so its not a white square, can I not make the slider white with the background of the slider black? And when I added this line WinSetTrans("[CLASS:Autoit v3 GUI]", "", GUICtrlRead($Slider1)) It didn't change the transperancy of the window, is there a command to set the value of the slider? as of now I am just using the actual slider variable that made the GUI $slider1 = GUICtrlCreateSlider(250, 5, 100, 20) Edited October 15, 2009 by kjpolker Link to comment Share on other sites More sharing options...
CodyBarrett Posted October 15, 2009 Share Posted October 15, 2009 (edited) guictrlread () winsettrans () edit : AH!! brett beat me to it Edited October 15, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
kjpolker Posted October 15, 2009 Author Share Posted October 15, 2009 (edited) I still need help lol, how do I determine the value of the slider? in the help file under GUICtrlSetData() it just says "For slider: value" and I don't know what that means, GUICtrlSetData($slider1, 'value') That wont work. And how do I make the slider a little more bolder and clearer ad make the background of the slider the color of my GUI window and not white? Edited October 15, 2009 by kjpolker Link to comment Share on other sites More sharing options...
CodyBarrett Posted October 15, 2009 Share Posted October 15, 2009 guictrlsetlimit? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
kjpolker Posted October 15, 2009 Author Share Posted October 15, 2009 Well I just realized that the GUICtrlSetData($slider1, 100) makes the pin on the slider start at 100 which is perfect, now for the actual transperancy your saying all I do is: $opacity = GUICtrlSetLimit(-1, 100, 0) WinSetTrans("[CLASS:Autoit v3 GUI]", "", GUICtrlRead($opacity)) Will work? Link to comment Share on other sites More sharing options...
CodyBarrett Posted October 15, 2009 Share Posted October 15, 2009 should... as long as the return value < 256.... like from 0 - 255 transparency [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
kjpolker Posted October 15, 2009 Author Share Posted October 15, 2009 So far I am having no luck with that, I have no idea what I am doing wrong though since I ahve never seen or done a opacity bar. =/ I mean i can move the slider but absolutely nothing happens to the window Link to comment Share on other sites More sharing options...
CodyBarrett Posted October 15, 2009 Share Posted October 15, 2009 while 1;YOUR MAIN WHILE LOOP winsettrans ('[active]','',Guictrlread ($Slider)) sleep (100) wend [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
ProgAndy Posted October 15, 2009 Share Posted October 15, 2009 Here is an example (Compatible with Beta and Stable) expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StructureConstants.au3> #include <SliderConstants.au3> #include<Misc.au3> #region - GUI Create $hGUI = GUICreate('test') GUISetBkColor(0) GUICtrlSetDefBkColor(0) Global $iSlider = GUICtrlCreateSlider(10, 10, 300, 30) GUICtrlSetBkColor(-1,0) GUICtrlSetLimit(-1, 255, 1) GUICtrlSetData(-1, 255) GUISetState() #endregion Global $giOldTRans If _VersionCompare(@AutoItVersion, '3.3.1.0') > 0 Then Execute('AdlibRegister("_UpdatePos", 100)') Else Execute('AdlibEnable("_UpdatePos", 100)') EndIf #region - GUI SelectLoop While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $iSlider WinSetTrans($hGUI, "", GUICtrlRead($iSlider)) EndSelect WEnd #endregion Func _UpdatePos() Local $trans = GUICtrlRead($iSlider) If $giOldTRans = $trans Then Return WinSetTrans($hGUI, "", $trans) $giOldTRans = $trans EndFunc *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
CodyBarrett Posted October 16, 2009 Share Posted October 16, 2009 nice example! [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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