Damein Posted July 1, 2013 Share Posted July 1, 2013 (edited) So the problem I am having is that I have a GUI that I want to be able to resize but when resizing the GUI the GDI lines drawn disappear. How can I make the GDI line resize with the GUI? Or is there a way to hook the call of the resize (IE: When someone resizes the GUI) to a function that I can create new GDI lines after they have resized and I can do a GetGetPos for the Width/Height. Here is my current script just to get an idea of the GDI fix. #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) _CreateProfitMainGUI() Func _CreateProfitMainGUI() $MainProfitGUI = GuiCreate("Profit System", 1400,800,default, default,BitOr($WS_SIZEBOX,$WS_MINIMIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GuiSetBkColor(0x000000) GuiSetState() _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($MainProfitGUI) $hPen = _GDIPlus_PenCreate(0xFF66CD00) _GDIPlus_GraphicsDrawLine($hGraphic, 0, 150, 1400, 150, $hPen) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) EndFunc Func _Exit() Exit EndFunc While 1 Sleep(10) WEnd As you can see I attempted to use GuiCtrlSetResizing but that didn't work lol Edited July 1, 2013 by Damein Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Damein Posted July 1, 2013 Author Share Posted July 1, 2013 I presume I may need to do something with GuiEventOptions but I've never worked with that so I may need a little push in the right direction xD Thanks in advanced for the help! Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 1, 2013 Moderators Share Posted July 1, 2013 Damein,Why not just use a label? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) _CreateProfitMainGUI() Func _CreateProfitMainGUI() $MainProfitGUI = GUICreate("Profit System", 1400, 800, Default, Default, BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetBkColor(0x000000) GUICtrlCreateLabel("", 0, 150, 1400, 2) GUICtrlSetBkColor(-1, 0x00FF00) GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKHEIGHT) GUISetState() EndFunc ;==>_CreateProfitMainGUI Func _Exit() Exit EndFunc ;==>_Exit While 1 Sleep(10) WEndDoes that do it? 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...
Damein Posted July 1, 2013 Author Share Posted July 1, 2013 Oh, good call. I will do that! Thanks Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic 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