Jump to content

GUI Re size + using GDI Lines


 Share

Recommended Posts

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 by Damein

MCR.jpg?t=1286371579

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

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!

MCR.jpg?t=1286371579

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

  • Moderators

Damein,

Why not just use a label? :huh:

#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)
WEnd
Does that do it? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Oh, good call. I will do that! 

Thanks

MCR.jpg?t=1286371579

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...