Jump to content
shokwave8

Backgroundcolour always changes do default.

Recommended Posts

shokwave8

Hello there Com,

The following is my problem. I try to create a window with Koda-Formdesigner and the background of the Form, Button and Edit shall be blue with white letters. Everytime i run the code the colour from button and edit background sets to default. 

i tried to set the backgroundcolour manually to blue for the button and the editbox but then the GUI just does not appear while running the script. 

I got you some screens of Koda (howitshould.jpg) and the actual running script (howitis.jpg). I hope you guys can help me :) 

Thanks for reading and replying.

(I'm german and i might did some mistakes in language :>)

#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Form1", 619, 442, 221, 182)
GUISetBkColor(0x0000FF)
$idPic = GUICtrlCreatePic("C:\Users\***\Downloads\Löwe Weiß1.jpg", 4, 4, 356, 364)
$Label1 = GUICtrlCreateLabel("TEST", 256, 48, 287, 36)
GUICtrlSetFont(-1, 20, 800, 0, "Cambria")
GUICtrlSetColor(-1, 0xFFFFFF)
$JOIN = GUICtrlCreateButton("JOIN", 400, 336, 185, 73)
GUICtrlSetFont(-1, 16, 800, 0, "Cambria")
GUICtrlSetColor(-1, 0xFFFFFF)
$Edit1 = GUICtrlCreateEdit("", 376, 96, 217, 233, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN))
GUICtrlSetData(-1, "Newest Updates:")
GUICtrlSetFont(-1, 10, 400, 0, "Cambria")
GUICtrlSetColor(-1, 0xFFFFFF)
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

 

 

howitshould.jpg

 

Howitis.jpg

Edited by shokwave8

Share this post


Link to post
Share on other sites
water

Fehler sind hier kein Problem! Wenn wir wo nicht klarkommen, dann fragen wir nach.

Could you please post the code generated by Koda?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Melba23

shokwave8,

You are not setting the background colour of the controls so unsurprisingly they default to the default colour.

Either use a GUICtrlSetBkColor command for each control, or use the GUISetDefColor/BkColor like this:

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>

$Form1_1 = GUICreate("Form1", 619, 442, 221, 182)
GUISetBkColor(0x0000FF)
GUICtrlSetDefBkColor(0x0000FF)
GUICtrlSetDefColor(0xFFFFFF)

$idPic = GUICtrlCreatePic("C:\Users\***\Downloads\Löwe Weiß1.jpg", 4, 4, 356, 364)
$Label1 = GUICtrlCreateLabel("Next Life RP-Funserver", 256, 48, 287, 36)
GUICtrlSetFont(-1, 20, 800, 0, "Cambria")
$JOIN = GUICtrlCreateButton("JOIN", 400, 336, 185, 73)
GUICtrlSetFont(-1, 16, 800, 0, "Cambria")
$Edit1 = GUICtrlCreateEdit("", 376, 96, 217, 233, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN))
GUICtrlSetData(-1, "Newest Updates:")
GUICtrlSetFont(-1, 10, 400, 0, "Cambria")

GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

A couple of points:

  • Colouring buttons fraught with danger as they can misbehave quite badly.
  • Looking at the title of the GUI, please read the Forum rules carefully before posting again

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
shokwave8

Oh i'm very sorry :o will not happen again

Very thanks to both of you :)

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 my friends
      I have an inquiry and I hope to find the answer here
      I want to create a graphical user interface
      but I want to hide the system menu
      I mean the window menu
      Is this possible?
      If is possible please give me how to do that
      Thanks in advance
    • helmar
      By helmar
      I was playing around with simple GUI creation.  I tend to like parameter driven coding (in prior life (years ago) as Clipper/FoxPro/dBase coder).  Just wanted to see what I could do with a GUI.
      #Region options, includes Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) ; Change to OnEvent mode #include <GUIConstantsEx.au3> #EndRegion options, includes Global Const $nCols = 2, $nRows = 6, $nSpacer = 10, $nBtnWidth = 150, $nBtnHeight = 30 Global $xName = 0, $xID = 0 Global $nGUIWidth = ($nCols * $nBtnWidth) + (($nCols + 1) * $nSpacer) Global $nGUIHeight = ($nRows * $nBtnHeight) + (($nRows + 1) * $nSpacer) Global $hMainGUI = GUICreate("Calculated GUI", $nGUIWidth, $nGUIHeight, -1, -1) For $xRows = 1 to $nRows ;in this arrangement, tabbing is left to right, then next row For $xCols = 1 to $nCols ;reverse the order of this line with the prior line for top to bottom tabbing, then next col $xName += 1 $xID += 1 Global $Dummy = GUICtrlCreateButton("Button" & $xName, _ ($nBtnWidth * ($xCols - 1)) + (($xCols - 1) * $nSpacer) + $nSpacer, _ ($nBtnHeight* ($xRows - 1)) + (($xRows - 1) * $nSpacer) + $nSpacer, _ $nBtnWidth, _ $nBtnHeight) GUICtrlSetOnEvent($xID+2, "Handler") Next Next GUISetOnEvent($GUI_EVENT_CLOSE, "CloseApp") GUISetState(@SW_SHOW) While 1 Sleep(10) WEnd Func CloseApp() Exit EndFunc Func Handler() MsgBox(0,0,"Button " & @GUI_CtrlId - 2) EndFunc  
    • DynamicRookie
      By DynamicRookie
      Hey there!
       
      Is there a way to detect movement only for 1 specific window?

      HWnd is not really working, it still detects movement in all the windows within the region

      This is my script:
       
      ;Checksum actual HotKeySet("{f2}", 'exit_') MsgBox(0, '', '0') Beep(500, 2000) $Hwnd = WinActive('') while 1 $Checksum = PixelChecksum(211, 650, 1094, 914, 1, $Hwnd) If PixelChecksum(211, 650, 1094, 914, 1, $Hwnd) <> $Checksum Then For $i = 1 To 100 Beep(1000, 50) Next MsgBox(0, '', 'New message!', 1) EndIf WEnd Func exit_() Beep(500, 1000) Exit 0 EndFunc I just want to check whenever a message comes because the app i use doesn't give notifications properly.

      Any help is really appreciated!
    • PramodR
      By PramodR
      Can you please see whats wrong im doing in the below code? i can read few registry entry but not all for eg, i am able to get value of "Shell" Key from the registry path  but not AutoAdminLogon which has the value of "1", is there any change i have to do to read numeric values?
       Global  $shello = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","Shell" )
       ConsoleWrite("This is Hello"& $shello)
      above command returns proper value , but same command with AutoAdminLogon returns null as shown in below ? infact registry has the value of 1.
       Global  $shello = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoAdminLogon" )
       ConsoleWrite("This is Hello"& $shello)
    • Eminence
      By Eminence
      Hello,
      I've been searching on how to select the first row in my database which includes a time column based on the latest start_time date for today's date.
      This is my current code:
      Local $iCurrentDate = _Now() Local $sqlHandle = _dbOpen($sDbPath) Local $aResult, $iRows, $iCols _SQLite_GetTable2d($sqlHandle, "SELECT start_time FROM " & $srawDb & " ORDER BY datetime(start_time) DESC LIMIT 1", $aResult, $iRows, $iCols) _ArrayDisplay($aResult) _dbClose($sDbpath) What it does is it gets the first row entry in the database however it does not select the latest start_time entry in the database, it always select the first row. I've tried changing DESC to ASC to see if that will do it but the issue still remains. Any thoughts on this? Thanks in advance.
       
      *EDIT
      The date format in the database is by MM/DD/YYYY HH:MM:SS.
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.