Jump to content
dzlee

how to fit all screen resolution when maximized form ?

Recommended Posts

dzlee

Hello!
when i push maximized in main form,
form controls overlap
and it depend on screen resolution , how overlap bad
how to deal with it
thanks

6-19-2015 1-34-22 PM.jpg

6-19-2015 1-36-12 PM.jpg

Edited by dzlee

Share this post


Link to post
Share on other sites
AutoBert

Look in the help for GUICtrlSetResizing

  • Like 1

Share this post


Link to post
Share on other sites
dzlee

little example will be great

Share this post


Link to post
Share on other sites
Rockerfeller

There is an example in the help file, have a go, it will not bite you.

Edited by Rockerfeller

Share this post


Link to post
Share on other sites
dzlee

<_< i saw the help example
at first i had a problem to understand it
so i ask for another example
that's it

Edited by dzlee

Share this post


Link to post
Share on other sites
AutoBert

Here's another example:

#include <GUIConstantsEx.au3>
#include<WindowsConstants.au3>

Global $hGui1, $hGui2 = -99, $idMsgBox, $idZurueck, $idbtnExit2
;_CreateGui2() ;entweder hier oder erst wenn benötigt ($idbtmToGui2 Klick)
#Region GUI1 #####################################################################################
$hGui1 = GUICreate('GUI 1', 400, 280, 140, 150, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX))
;erzeugt eine GUI , das zurückgebebene Handle wird in der Variablen $hGui1 gespeichert
;die GUI hat BOXen für Mininmieren, Maximieren und ist in der Größe frei änderbar

$idbtnToGui2 = GUICtrlCreateButton('&Aufruf GUI 2', 20, 20, 100, 21)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKLEFT + $GUI_DOCKTOP)
;verankert den Button "Afruf Gui 2" links und oben und fixiert die Größe
;beim Resizen bleibt es dadurch auf seiner Position am rechten Rand

$idbtnICQ = GUICtrlCreateButton('&ICQ', 20, 50, 100, 21)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKLEFT + $GUI_DOCKTOP)
;verankert den Button "ICQ" links und oben und fixiert die Größe
;beim Resizen bleibt es dadurch auf seiner Position am rechten Rand

$idbtnExit1 = GUICtrlCreateButton('be&enden', 280, 225, 100, 21)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM)
;verankert den Button "Afruf Gui 2" links und oben und fixiert die Größe
;beim Resizen bleibt es dadurch auf seiner Position am rechten Rand

GUISetState(@SW_SHOW, $hGui1)
#EndRegion ###########################################################################################

While 1
    $nMsg = GUIGetMsg(1) ;extended Modus wichtig!!
    Switch $nMsg[1] ;für welches Fenster ist die Message
        Case $hGui1 ;ab hier ist Gui 1 dran
            Switch $nMsg[0] ;welche Message wurde ausgelöst
                Case $idbtnToGui2
                    GUISetState(@SW_DISABLE, $hGui1) ;Gui 1 gegen Benutzereingaben sperren
                    If $hGui2 = -99 Then _CreateGui2() ;nur wenn nicht am Anfang bereits erzeugt nötig, dann auf Vorbelegung der Variable in Global achten)
                    GUISetState(@SW_SHOW, $hGui2) ;Gui 2 anzeigen
                Case $idbtnICQ
                    MsgBox(0, "", "Jetzt würde ICQ gestartet", 0, $hGui1)
                    ;Run("C:\Program Files\ICQ7.0\ICQ.exe")
                Case $idbtnExit1, $GUI_EVENT_CLOSE
                    _end()
            EndSwitch
        Case $hGui2 ;ab hier ist Gui 2 dran
            Switch $nMsg[0] ;welche Message wurde ausgelöst
                Case $idMsgBox
                    MsgBox(0, 'Test', 'Test', 0, $hGui2)
                Case $idZurueck, $GUI_EVENT_CLOSE
                    GUISetState(@SW_ENABLE, $hGui1) ;Gui 1 wieder entsperren
                    GUISetState(@SW_HIDE, $hGui2)   ;Gui 2 verstecken
                Case $idbtnExit2
                    _end()
            EndSwitch
    EndSwitch
WEnd

Func _CreateGui2()
    $hGui2 = GUICreate('GUI 2', 400, 280, 200, 50, -1, -1, $hGui1) ;wichtig ist der letzte Parameter
    ;erzeugt eine GUI als Child von Gui1, das zurückgebebene Handle wird in der Variablen $hGui2 gespeichert
    $idMsgBox = GUICtrlCreateButton('&MsgBox', 20, 20, 100, 21)
    $idZurueck = GUICtrlCreateButton('&Zurück zu GUI 1', 20, 50, 100, 21)
    $idbtnExit2 = GUICtrlCreateButton('be&enden', 280, 250, 100, 21)
    GUISetState(@SW_HIDE, $hGui2) ;Gui 2 vorerfst verstecken
EndFunc   ;==>_CreateGui2

Func _end()
    GUIDelete($hGui2)
    GUIDelete($hGui1)
    Exit
EndFunc   ;==>_end

 

  • Like 1

Share this post


Link to post
Share on other sites
dzlee

thank you AutoBert
god  bless you
[solved]^_^

Share this post


Link to post
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

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Hello, dear.
      I am a newbie in autoit language
      I don't master any other programming language.
      I also don't understand how to manage the DLL files
      In addition to all this I am blind, and as we all know the explanations provided for the blind in programming are very few.
      So I'm trying to rely on myself for learning.
      I work hard to design some simple software and tools that make it easier to use computers, as they perform some tasks that may be difficult for the blind.
      I am also looking for the programs that the blind need and cannot use it because it's haven't the compatibility with the screen reader, and i try to design a simple programs that do the same work.
      In these tools and programs I have to deal directly with screen readers, when i must to forcing these programs to read some processes and tasks that it cannot be read in normal mode.
      To force these programs to read, I have to deal with the API files.
      And as I said, I'm very weak in managing DLLs.
      So I hope you'll try to help me, please.
      I did a lot of research until I found the API file to manage the free screen reader (NVDA).
      It is open source
      It is based on CPP language and Python
      And I don't understand the both languages.
      For this I decided to put you an API file link here which is attached with it examples, source and DLL file
      I hope you can help me by convert these functions to AutoIt include file
      I offer you a very serious apology if the participation is a violation of the laws.
      I wish I could find here someone to help me.
      To download the file please click on this link
      http://www.nvda-project.org/nvdaControllerClient/nvdaControllerClient_20100219.7z
      and To download the free screen reader,  please following this link
      https://www.nvaccess.org/download/

      I repeat my apologies and thanks in advance.
       
    • Skeletor
      By Skeletor
      MS Splash Screens
      The office 2016/17 office suite has made many people turn heads with its functions and especially their splash screen.
      I now present to you, the MS Style Splash Screen. For Rookies, Novices and anyone who wants a ready made splash screen for your gui application.

      You can now download it and also try it out yourself.
      You have three colors to choose from:
      Blue
      Red
      Green
      All three colours are from the famous programs.
      I also included the KODA form to you can have freedom with this splash screen.
      Note: the KODA form does not have the three colours as well as the correct blue. 

      Have fun and enjoy.
      Note:
      Thanks to kaz for updating the side scrolling dots.
       
       
    • Errious
      By Errious
      Hello,
      i am searching for a function that allows me some very specific functions for Screen Captures.
       
      First should be the possibillity to create a Screenshot from a specific window and this is possibly under another window but has to stay there and not getting forced to be in the first - layer position if this is clear enough :-) The other thing should be the ability to create a Screen Capture every couple minutes or a specific period.  
      I tried a lot of Screen Capture tools but neither can do both together.
      Also my try to create my own script with AutoIT failed, because of missing knoweledge about how to use it for this specific reasons, would be very kind if someone can tell me in the first place if this is possible at all and maybe someone has allready an idea about how to realize it?
       
      best regards
       
       
       
       
    • Skeletor
      By Skeletor
      Hi All,
      I know many newbies search for this feature.
      I decided to share this piece of code with everyone.
      Basically its a "splash screen" that has a transparent image.
      In a nutshell - Gui with a transparent gif.
      Enjoy...
      Download attachment....
       
      Splash Screen GUI.zip
    • Xandy
      By Xandy
      Screenshot program that can upload/FTP to website/storage with hotkey.
      Features GUI to display programmable keys.

      Set the hotkeys with this function to use, and display hotkeys.
      ; hotkey_set() Parameters: ; ----------------------------------------------------------- ; $aHotkey -                The array hotkeys are stored in. This function sets the values of this array[hotkey_id][$hotkey_data] ; $dHotkey_id -             The enum for this hotkey index ; $sHotkey_description -     The label displayed to the user to represent function of hotkey ; $sHotkey_name -            The hotkey it'self.  Whatever name string you want to give the key ; $dHotkey_key -             The _IsPressed keycode ;    Keycodes AT: https://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm ; $dHotkey_shift -             Shift flag 0 or 1 Default off ; $dHotkey_ctrl -             Ctrl flag 0 or 1 Default off ; $dHotkey_alt -             Alt flag 0 or 1 Default off Func hotkey_set(ByRef $aHotkey, $dHotkey_id, $sHotkey_description, $sHotkey_name, $dHotkey_key, $dHotkey_shift = 0, $dHotkey_ctrl = 0, $dHotkey_alt = 0)     $aHotkey[$dHotkey_id][$eHotkey_data_key_description] = $sHotkey_description     $aHotkey[$dHotkey_id][$eHotkey_data_key_name] = $sHotkey_name     $aHotkey[$dHotkey_id][$eHotkey_data_key] = $dHotkey_key     $aHotkey[$dHotkey_id][$eHotkey_data_shift] = $dHotkey_shift     $aHotkey[$dHotkey_id][$eHotkey_data_ctrl] = $dHotkey_ctrl     $aHotkey[$dHotkey_id][$eHotkey_data_alt] = $dHotkey_alt EndFunc   ;==>hotkey_set ; You can set your hotkeys here ; Please visit the hotkey_set() function for parameter information hotkey_set($aHotkey, $eHotkey_screenshot_ftp, "Selected Window to FTP", "F12", "7B", 0, 1, 0); F12 hotkey_set($aHotkey, $eHotkey_screenshot_disk, "Selected Window to Disk", "S", "53", 1, 1, 1); S hotkey_set($aHotkey, $eHotkey_clipboard_send, "Send Clipboard keystrokes", "F10", "79", 1, 1, 1); F10  
      Configure settings dialog:

      Screenshot Filename and Screenshot Counter, are used to create simple unique filenames that can cycle. Copy URL to clipboard option. - For linking your screenshots. The screenshot file type is for local copy only. App always uses .JPG for FTP right now, but I could add FTP screenshot file type specification.  
      Any suggestions?  Did I break anything, what did I miss?
      Package uses TTS.au3 by Beege: 
       
      FTP_Screen.zip
      File includes:
         - FTP_Screen.au3
         - FTPScreen.ico
         - TTS.au3 - by Beege
×