Renderer Posted January 14, 2017 Share Posted January 14, 2017 Hello there! Today i want to ask you how to draw a shadow around a GUI Control, whether it is button, or label, or anything else. Thanks in advance! Link to comment Share on other sites More sharing options...
careca Posted January 15, 2017 Share Posted January 15, 2017 Maybe you'll have to mess with transparency and overlays, using an image with a shadow and transparency, placing it over a button...idk, seems complicated. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
InunoTaishou Posted January 15, 2017 Share Posted January 15, 2017 Something like this? #include <GUIConstants.au3> #include <WinAPI.au3> #include <SendMessage.au3> Global $hMain = GUICreate("") Global $btnOne = GUICtrlCreateButton("", 10, 10, 100, 20) Global $lblText = GUICtrlCreateLabel("This is some text", 110, 40, 100, 20) GUISetState(@SW_SHOW, $hMain) GUICtrlAddShadow($btnOne) GUICtrlAddShadow($lblText) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit 0 EndSwitch WEnd Func GUICtrlAddShadow(Const $iCtrl) Local $hCtrl = GUICtrlGetHandle($ictrl) Local $hParent = _WinAPI_GetParent($hCtrl) Local $aPos = ControlGetPos($hParent, "", $iCtrl) Local $lblShadow = GUICtrlCreateLabel("", $aPos[0] + 3, $aPos[1] + 3, $aPos[2], $aPos[3]) GUICtrlSetBkColor($lblShadow, 0x3E3E3E) GUICtrlSetState($lblShadow, $GUI_DISABLE) GUICtrlSetState($iCtrl, $GUI_ONTOP) _SendMessage($hCtrl, $WM_MOUSEFIRST) Return $lblShadow EndFunc Couldn't figure out how to refresh the control and make it on top of the shadow but calling AddShadow after the GUI is shown + the _SendMessage + setting the control to ONTOP did it. _WinApi_RedrawWindow didn't work (using $hCtrl and $hParent, neither worked) Link to comment Share on other sites More sharing options...
czardas Posted January 15, 2017 Share Posted January 15, 2017 (edited) Interesting question. Have you tried all the control styles? Here's an idea: take a screenshot of your GUI, draw the shadow around the controls using graphics software and then set the image as the GUI background. For resizing you'll have to ask a graphics expert. Edited January 15, 2017 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Renderer Posted January 15, 2017 Author Share Posted January 15, 2017 (edited) 13 minutes ago, czardas said: Interesting question. Have you tried all the control styles? Here's an idea: take a screenshot of your GUI, draw the shadow around the controls using graphics software and then set the image as the GUI background. For resizing you'll have to ask a graphics expert. I just wanna find out how to draw a shadow around a GUI Control only by using codes, without using images and other stuff like that. Edited January 15, 2017 by Renderer Link to comment Share on other sites More sharing options...
czardas Posted January 15, 2017 Share Posted January 15, 2017 (edited) Ah, then try all the control styles. I don't know if there is a universal drop shadow style which applies to all control types - I kind of doubt it. It might should be possible to redraw everything using code, but don't ask me how. Edit1: The styles I've tried seem to only do 3D type effects for controls like buttons (not specifically drop shadow). Edit2: GDI+ is another possibility. It's probably the easiest approach. You might even find something in example scripts. Edited January 15, 2017 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 15, 2017 Moderators Share Posted January 15, 2017 Renderer, This thread shows how it was done on XP & Vista - but I have no idea if it still works with more modern OSes. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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