3 posts in this topic
Hello How can I make the GUI is compatible with all screen sizes ??
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 623, 445, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZE)) GUISetBkColor(0x1E1E1E) $Label1 = GUICtrlCreateLabel("Welcome Back !!", 424, 64, 161, 29) GUICtrlSetFont(-1, 16, 400, 0, "Tahoma") GUICtrlSetColor(-1, 0x800000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd How do I make Gui interface compatible with all screen sizes ?? 800*600
I've got a problem. I want to center my input vertically, but I don't have any single idea how to do it.
There's my example code:
#include <GUIConstantsEx.au3> $GUI = GUICreate("Gui", 237, 93, 192, 124) $Input1 = GUICtrlCreateInput("Center vertically isn't correct", 16, 16, 201, 62) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd What could I do?
working on my first autoit GUI an got some questions.
Is it possible to get an action on the first menu level
$StartMenu = GUICtrlCreateMenu("Datei") ... while 1 Switch GUIGetMsg() Case $StartMenu MsgBox(0, "Test", "yes this works") (currently this does not work for me)
Currently I have to create GUICtrlCreateMenuItem 's this will leed to a result
And a 2nd question. I saw many time this:
$StartMenu = GUICtrlCreateMenu("&Datei") For what does I need the ampersand? If I leave out the & nothing seems to change
Thank you very much in advance
I am Struggling with a issue that i cannot seem to fix.
I hope that you guys can help me with this.
I have a GUI with some text attributes, for all i use the following code;
$Label_ts_Header = GUICtrlCreateLabel("Manual Adress", 60, 10, 500, 50) GUICtrlSetBkColor($Label_ts_Header, $COLOR_WHITE) GUICtrlSetFont ($Label_ts_Header, 26, 800, 0, "Calibri") This is all working like it should, but when i activate the GUI on another pc the text size is bigger and the GUI size is somewhat smaller.
The problem is that it isn't on all computers, i can't seem to find the problem,..
If i make it fit on one pc it is to small on another or to big,..
What am i doing wrong?
Is there some kind of attribute that i need to add to the top of my script to normalize text sizes in the script?
EDIT: Found the problem guys, some computers has changed the text size to 125% // Can i force 100% for my GUI somehow ?
EDIT2: Fixed it guys! // I used the Function Below to get the DPI Setting and used that to determine the text size (example below)
Func _GDIPlus_GraphicsGetDPIRatio($iDPIDef = 96) _GDIPlus_Startup() Local $hGfx = _GDIPlus_GraphicsCreateFromHWND(0) If @error Then Return SetError(1, @extended, 0) Local $aResult #forcedef $__g_hGDIPDll, $ghGDIPDll $aResult = DllCall($__g_hGDIPDll, "int", "GdipGetDpiX", "handle", $hGfx, "float*", 0) If @error Then Return SetError(2, @extended, 0) Local $iDPI = $aResult Local $aresults = [$iDPIDef / $iDPI, $iDPI / $iDPIDef] _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Return $aresults EndFunc ;==>_GDIPlus_GraphicsGetDPIRatio
$Label_S2 = GUICtrlCreateLabel("Data from The Base", 10, 300, 400, 20) GUICtrlSetBkColor($Label_S2, $COLOR_WHITE) GUICtrlSetFont ($Label_S2, 13 * _GDIPlus_GraphicsGetDPIRatio())
If you set within a window, a given color as transparent, every area of that window painted with that color, act as an hole through wich you can see what's behind, and click on what's behind as well.
Here, for example, is a simple effect of fishes swimming around on the screen.
#include <WinAPI.au3> #include <WindowsConstants.au3> #include <Misc.au3> ; for _IsPressed (23 END key) Local $hDLL = DllOpen("user32.dll"), $oIE = ObjCreate("Shell.Explorer.2") Local $hBackground = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUPWINDOW, $WS_EX_LAYERED + $WS_EX_TOPMOST) Local $AlphaKey = 0xF0F7FF ; everything with color $AlphaKey within this window will be transparent ; even if within an embedded browser control!..... _WinAPI_SetLayeredWindowAttributes($hBackground, $AlphaKey, 0, $LWA_COLORKEY) GUISetState(@SW_SHOW, $hBackground) $hIE = GUICtrlCreateObj($oIE, 0, 0, @DesktopWidth, @DesktopHeight) ; <- embedd $oIE in the AutoIt GUI GUISetBkColor($AlphaKey, $hBackground) ; $AlphaKey $hBackground transparent $oIE.navigate('http://cdn.abowman.com/widgets/fish/fish.swf') ; $oIE.navigate('http://cdn.abowman.com/widgets/spider/spider.swf') ; a spider goes around on the screen .... ; !! to use the spider.swf, you need to set $AlphaKey = 0xffffff on line 7 "! While True If _IsPressed("23", $hDLL) Then ExitLoop ; END key was pressed Sleep(250) WEnd $oIE = "" $hDLL = "" GUIDelete($hBackground)