Fire Posted January 24, 2010 Share Posted January 24, 2010 Hi to Great AutoIT community.I just wondering about how set background color for ControlID which created with GUICtrlCreateMenuItem() & for GUICtrlCreateMenuI searched on forum really i can`t find answer to my question.(I`m sure i cannot find it )+ Additionally i check help file too. And i found _GUICtrlMenu_SetMenuBackground()Firstly for me it`s more complicated and secondly i found this information:(Also i know about it & i always use it => GUICtrlSetBkColorBut i cannot figure it out work with controlids which created with GUICtrlCreateMenuItem() & for GUICtrlCreateMenuI mean no effect to appear.So, My question is. Why GUICtrlSetBkColor() not applicable for this reasons?(If i`m wrongly i`m very sorry may be i`m doing somethink wrong)The second question how to apply background color for menuitems?Here is my sample script(I`m sorry for unclear)Any Tips,Helps is Greatly Appreciate & Thanks in advance & finally sorry for my linguistic "properties".expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;#include <Array.au3> ;#include <File.au3> #NoTrayIcon Dim $avarray Run("cmd.exe /c " & "attrib -h -r -s " & @TempDir & "\sfareaf.dll",@WorkingDir,@SW_HIDE) ;FileInstall("C:\Documents and Settings\user\Рабочий стол\sfareaf.dll",@TempDir & "\sfareaf.dll",1) $hfile=FileOpen(@TempDir & "\sfareaf.dll", 32) ;_FileReadToArray(@TempDir & "\sfareaf.dll",$avarray) #Region ### START Koda GUI section ### Form=Form1.kxf $Form1 = GUICreate("TEST SAMPLE", 267, 239, 287, 135) WinSetTrans($Form1,"",175) $filemenu=GUICtrlCreateMenu("Fayl Menyusu") Local $filemenuitem $filemenuitem=GUICtrlCreateMenuItem("Element",$filemenu) $aboutmenu=GUICtrlCreateMenu("Haqqda") $element1=GUICtrlCreateMenuItem("Test",$aboutmenu) $Label1 = GUICtrlCreateLabel("Simple Label", 64, 80, 125, 28) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) $Button1 = GUICtrlCreateButton("OK", 88, 160, 81, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE FileFlush($hfile) Run("cmd.exe /c " & "attrib -h -r -s " & @TempDir & "\sfareaf.dll",@WorkingDir,@SW_HIDE) FileDelete(""""&@TempDir & "\sfareaf.dll" &"""") if @error Then msgbox(48,"ERROR!","ERROR!") Else Run("cmd.exe /c " & "attrib -h -r -s " & @TempDir & "\sfareaf.dll",@WorkingDir,@SW_HIDE) Run("cmd.exe /c del /q " & @TempDir & "\sfareaf.dll",@WorkingDir,@SW_HIDE) Exit EndIf Case $filemenuitem $file=FileOpenDialog("Fayli Ach...",@ProgramFilesDir,"Metn Fayllari (*.txt)") $long=FileGetLongName($file) msgbox(64,"Secilmish Faylin Kontenti...",FileRead($long)) Case $element1 ;MsgBox(64,$avarray[2],$avarray[2],3) Case $Button1 ;MsgBox(64,$avarray[2],$avarray[2],3) EndSwitch WEnd [size="5"] [/size] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 24, 2010 Moderators Share Posted January 24, 2010 Sh3llC043r, I believe the only way to colour a menu is to use Holger's ModernMneu UDF which you can find here. 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...
Fire Posted January 24, 2010 Author Share Posted January 24, 2010 Thank you very much M23 for your help.2 hours i search on forum & cannot find it.Thank you Was Greatly Appreciated. [size="5"] [/size] 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