hello
i have made a gui in mostly black based on watching a CivReborn vid it has 2 listboxes that burn my eyes so i was trying to get the color to change but i cant figure it out i i am no expert in programming
could someone point me in the right direction if there is one plz or perhaps a way to have a image as a background
currently it looks like the image i included but i want it to be white on black, i know how to change the text color but not for the listbox
any pointers are appreciated thank you
Listbox in black with white letters possible? Topic is solved
Listbox in black with white letters possible?
- Attachments
-
- 1.jpg (70.92 KiB) Viewed 1502 times
Last edited by OCP on 26 Jul 2018, 22:40, edited 1 time in total.
Re: Listbox in black with white letters possible? Topic is solved
Yes it is.
questions?
BTW that's a nice looking quick run program you have there.
Code: Select all
Gui,Color,Black, Black
Gui,Add,Listbox,cWhite
BTW that's a nice looking quick run program you have there.
Re: Listbox in black with white letters possible?
Ha the man himself that worked great thank you so much this thing is just awesome i changed it to open at my current mouse position and also i open it with middle mouse down mouse wheel up and down to close very nice thnx for making the video
ill share the result with you
ill share the result with you
Last edited by OCP on 26 Jul 2018, 22:40, edited 1 time in total.
Re: Listbox in black with white letters possible?
oh yeah the edit knob was behaving badly i removed it because the edit box did the same thing
here is the script it has no visible borders and opens with middle mouse down then mouse wheel up and close it with Down
i might have to tweak the code a bit because if i scroll up to far the gui will jump to somewhere in the screen so far its handy and something i can get used to but it could be better
here is the script it has no visible borders and opens with middle mouse down then mouse wheel up and close it with Down
i might have to tweak the code a bit because if i scroll up to far the gui will jump to somewhere in the screen so far its handy and something i can get used to but it could be better
Code: Select all
#SingleInstance, force
SetWorkingDir,%A_ScriptDir%
; Pages and folders
Web_list1:= "DRIVE - C"
Web_list2:= ["C:\"]
;================================================================================================================================
; Programs and scripts
Programs_list1:= "AHK - Always On Top"
Programs_list2:= ["E:\Always On Top.exe"]
return
#InstallKeybdHook
GuiClose:
Gui,1:Destroy
Return
Run_Web_Page:
;Gui,1:Destroy
Gui,1:Submit,NoHide
try
{
Run,% Web_list2[Web_Box]
}
catch
{
MsgBox, 262192, ,Error
}
return
Run_Program:
;Gui,1:Destroy
Gui,1:Submit,NoHide
try
{
Run,% Programs_list2[Programs_Box]
}
catch
{
MsgBox, 262192, ,Error
}
return
Unlock:
Lock1:=!Lock1
if(Lock1=1)
{
GuiControl,1:Enable,Edit_Button
GuiControl,1:Enable,Path_Button
}
if(Lock1=0)
{
GuiControl,1:Disable,Edit_Button
GuiControl,1:Disable,Path_Button
}
Edit_This_Script:
Try
{
Run, Edit %A_WorkingDir%\Quik Run Mini.ahk
}
catch
{
MsgBox, 262192, ,Error
}
return
Get_Path:
Gui,1:Hide
Clipboard:=""
While(!GetKeyState("Ctrl"))
Tooltip, Select the program you want to add and then press "CTRL"
ToolTip,
Sleep,50
Send,^c
Sleep,50
temp:=Clipboard
Sleep,50
Clipboard:=temp
Gui,1:Show,x1100 y50
return
Exit:
Gui,1:Destroy
return
~MButton & WheelUp::
mouseGetPos,mx,my
mx-=377
my+=-190
Gui,1:Destroy
Gui,1:+AlwaysOnTop
Gui,1:Color,Black
Gui,1:Font, s12 w700 cBlack Verdana
Gui,1:Add,Groupbox, cWhite x10 y10 w278 h264 Section,> Web and Folders <
Gui,1:Add,Button,xs+10 ys+24 w258 h20 gRun_Web_Page,Open Me
Gui,1:Add,Listbox,cWhite xs+10 ys+50 w258 r10 AltSubmit vWeb_Box ,% Web_list1
Gui,1:Add,Groupbox, cWhite xs+290 y10 w278 h304 Section,> Programs and Script's <
Gui,1:Add,Button,xs+10 ys+24 w258 h20 gRun_Program,Run Me
Gui,1:Add,ListBox,cWhite xs+10 ys+50 w258 r12 AltSubmit vPrograms_Box ,% Programs_list1
Gui,Add,Checkbox, cWhite x20 ys+276 vLock1 gUnlock,Edit Me
; Gui, Color, 000000
Gui,Color,Black, Black
WinSet, TransColor, 000000
Gui -Caption
;Gui,1:Add,Button,x+10 w40 h15 Disabled vEdit_Button gEdit_This_Script,Edit
Gui,1:Add,Button,x+10 w80 h18 Disabled vPath_Button gGet_Path,Get Path
Gui,1:Add,Button,x+15 w80 h18 vExit_button gExit,Close
Gui,1:Show,x%mx% y%my% ,Quick Run
Gui,1:Submit,NoHide
return
MButton & WheelDown::
Send, {Esc}
Gui,1:Destroy
Return
^Esc::
ExitApp
Last edited by OCP on 26 Jul 2018, 22:40, edited 1 time in total.
Re: Listbox in black with white letters possible?
ok here are the causes of a few of the problems.
The "Unlock" sub is missing a return at the end of it, so it is bleeding into the "Edit_This_Script" sub.
With that fixed you can re-add your "edit" button, but you will need to play with your spacing again.
In the video I had improvised adding the "Gui,destroy" to the top of the subs without really thinking on it, it should be after the "gui,submit" or the variables don't end up getting the new values. So if you drop them down a line you can start using them.
*Bonus*
Here is how you can move your window without having to add the caption back.
In the Gui, add a text control at the bottom, just before the gui,show
Then add this label
Questions?
**Edit**
You should also set the coordmode to screen.
At the top of your script, under "SingleInstance force", add:
That way the x & y of your window will always be where you are expecting it to be.
**Edit2** lol
You have this:
I think you are going for this:
Note the "," before the type
The "Unlock" sub is missing a return at the end of it, so it is bleeding into the "Edit_This_Script" sub.
With that fixed you can re-add your "edit" button, but you will need to play with your spacing again.
In the video I had improvised adding the "Gui,destroy" to the top of the subs without really thinking on it, it should be after the "gui,submit" or the variables don't end up getting the new values. So if you drop them down a line you can start using them.
*Bonus*
Here is how you can move your window without having to add the caption back.
In the Gui, add a text control at the bottom, just before the gui,show
Code: Select all
Gui,1:Add,Text,x10 y0 w550 h30 BackgroundTrans gMove_Window,
Code: Select all
Move_Window:
PostMessage,0xA1,2
return
**Edit**
You should also set the coordmode to screen.
At the top of your script, under "SingleInstance force", add:
Code: Select all
Coordmode,mouse,screen
**Edit2** lol
You have this:
Code: Select all
Gui,1:Font, s12 w700 cBlack Verdana
Code: Select all
Gui,1:Font, s12 cBlack, Verdana
Re: Listbox in black with white letters possible?
cool thnx the thing now always appears where i want it to be plus the edit works as intended now very nice
if i remove Gui -Caption the gui is no longer transparent i don't understand why i would need that to begin with to be honest, the only place where the gui will appear not at my mouse position is when you use the get path function and when i do i want it to appear on the top right out out the way of things i need to edit then. (this position i still need to fine tune a bit)
Gui,1:Font, s12 w700 cBlack, Verdana (w700 sets the bold level here i got pretty bad eyes fixed the missing , )
i added closing the gui if you click open me or run me, everything now works as i had intended
already thinking about a hotkey version so i can remove some of the about 70 hotkeys from my keyboard into such an idea
thnx for all your help learned a lot doing this
if i remove Gui -Caption the gui is no longer transparent i don't understand why i would need that to begin with to be honest, the only place where the gui will appear not at my mouse position is when you use the get path function and when i do i want it to appear on the top right out out the way of things i need to edit then. (this position i still need to fine tune a bit)
Gui,1:Font, s12 w700 cBlack, Verdana (w700 sets the bold level here i got pretty bad eyes fixed the missing , )
i added closing the gui if you click open me or run me, everything now works as i had intended
already thinking about a hotkey version so i can remove some of the about 70 hotkeys from my keyboard into such an idea
thnx for all your help learned a lot doing this
Last edited by OCP on 26 Jul 2018, 22:40, edited 1 time in total.
Re: Listbox in black with white letters possible?
if someone is interested here is the new version (removed most of my links ofc)
it looks like this
Code: Select all
#SingleInstance, force
Coordmode,mouse,screen
SetWorkingDir,%A_ScriptDir%
; Pages and folders
Web_list1:= "DRIVE - C|WEB - Sort My List|WEB - Youtube||"
Web_list2:= ["C:\","http://sortmylist.com/","https://www.youtube.com/"]
;================================================================================================================================
; Programs and scripts
Programs_list1:= "WIN - Services|"
Programs_list2:= ["C:\Windows\system32\services.msc"]
return
GuiClose:
Gui,1:Destroy
Return
Run_Web_Page:
Gui,1:Submit,NoHide
Gui,1:Destroy
try
{
Run,% Web_list2[Web_Box]
Gui, Destroy
}
catch
{
MsgBox, 262192, ,Error
}
return
Run_Program:
Gui,1:Submit,NoHide
Gui,1:Destroy
try
{
Run,% Programs_list2[Programs_Box]
Gui, Destroy
}
catch
{
MsgBox, 262192, ,Error
}
return
Unlock:
Lock1:=!Lock1
if(Lock1=1)
{
GuiControl,1:Enable,Edit_Button
GuiControl,1:Enable,Path_Button
}
if(Lock1=0)
{
GuiControl,1:Disable,Edit_Button
GuiControl,1:Disable,Path_Button
}
return
Edit_This_Script:
Try
{
Run, Edit %A_WorkingDir%\Quik Run Mini.ahk
}
catch
{
MsgBox, 262192, ,Error
}
return
Get_Path:
Gui,1:Hide
Clipboard:=""
While(!GetKeyState("Ctrl"))
Tooltip, Select the program you want to add and then press "CTRL"
ToolTip,
Sleep,50
Send,^c
Sleep,50
temp:=Clipboard
Sleep,50
Clipboard:=temp
Gui,1:Show,x1100 y50
return
Exit:
Gui,1:Destroy
return
;Move_Window:
; PostMessage,0xA1,2
; return
~MButton & WheelUp::
mouseGetPos,mx,my
mx-=377
my+=-190
Gui,1:Destroy
Gui,1:+AlwaysOnTop
Gui,1:Color,Black
Gui,1:Font, s12 w700 cBlack, Verdana
Gui,1:Add,Groupbox, cWhite x10 y10 w278 h264 Section,> Web and Folders <
Gui,1:Add,Button,xs+10 ys+24 w258 h20 gRun_Web_Page,Open Me
Gui,1:Add,Listbox,cWhite xs+10 ys+50 w258 r10 AltSubmit vWeb_Box ,% Web_list1
Gui,1:Add,Groupbox, cWhite xs+290 y10 w278 h304 Section,> Programs and Script's <
Gui,1:Add,Button,xs+10 ys+24 w258 h20 gRun_Program,Run Me
Gui,1:Add,ListBox,cWhite xs+10 ys+50 w258 r12 AltSubmit vPrograms_Box ,% Programs_list1
Gui,Add,Checkbox, cWhite x20 ys+276 vLock1 gUnlock,Lock
Gui,Color,Black, Black
WinSet, TransColor, 000000
Gui -Caption
Gui,1:Add,Button,x+10 w40 h18 Disabled vEdit_Button gEdit_This_Script,Edit
Gui,1:Add,Button,x+10 w50 h18 Disabled vPath_Button gGet_Path,Path
Gui,1:Add,Button,x+10 w80 h18 vExit_button gExit,Close
;Gui,1:Add,Text,x10 y0 w550 h30 BackgroundTrans gMove_Window,
Gui,1:Show,x%mx% y%my% ,Quick Run
Gui,1:Submit,NoHide
return
MButton & WheelDown::
Send, {Esc}
Gui,1:Destroy
Return
^Esc::
ExitApp
- Attachments
-
- new look.jpg (80.78 KiB) Viewed 1442 times
Last edited by OCP on 26 Jul 2018, 22:41, edited 1 time in total.
Re: Listbox in black with white letters possible?
The -Caption option removes the title bar, border from your gui, it doesn't have anything to do with transparency.OCP wrote:
if i remove Gui -Caption the gui is no longer transparent i don't understand why i would need that to begin with to be honest,
Built into the title bar "Caption" is the ability to click and move your window around, The text control & "Move_Window" sub that I gave you would allow you to click at the top of the gui and move it around without having the caption.
As for your inclusion of the line " WinSet, TransColor, 000000 " , fortunately you didn't add the one thing that would have made this work.
To get the winset, transcolor to act on your gui, you would have needed to include in your guis options "+LastFound". If you had added that, everything on your gui that had the color "000000" (or Black) would have been entirely transparent to the point that you could click the stuff under your window. In your case, I don't think that this is what you are trying for, so I would remove that line. For fun you should try adding +Lastfound before you do that so you can see how it works .
If you are unsure of where to add the +LastFound, just put it next to +AlwaysOnTop.
Sort of like this.
Gui,1:+AlwaysOnTop +LastFound
Winset,Transcolor,000000
Question?
Re: Listbox in black with white letters possible?
ok cool ill try that
already moved on to converting this into a fl studio shortcut launcher just a static one with knobs to get rid of the army of hotkeys on my keyboard, in that i need what you just posted thnx i already got some code like this but you explaining it rly helps.
yup i have a few questions to further increase my understanding
1 the way i open the launcher causes it to scroll down on the left side (i use middle mouse followed by mouse wheel up to open it. and middle mouse followed by mouse wheel down to close it)
Can this be set not to happen in some way? i kinda like how it opens so i would like to keep that for this launcher and then again its not a big deal but still the last thing i could improve on in this one function wise
2 sort the list of added links by alphabet in ListBox can this be done automatically ? or do i just need to insert at right place?
3 can you overlay images in gui in such a way you can still click on stuff? so i could use images as a color tool to make for example a box in yellow for all my shortcuts for... blue for shortcuts type... and so on?
the one thing that annoys me in gui is its ugly buttons shining at me, ive looked into that but its above my head for now all the color stuff seams to be complicated.
feel free to just point me to a tut or so you've helped me so much already thank you i appreciate it
already moved on to converting this into a fl studio shortcut launcher just a static one with knobs to get rid of the army of hotkeys on my keyboard, in that i need what you just posted thnx i already got some code like this but you explaining it rly helps.
yup i have a few questions to further increase my understanding
1 the way i open the launcher causes it to scroll down on the left side (i use middle mouse followed by mouse wheel up to open it. and middle mouse followed by mouse wheel down to close it)
Can this be set not to happen in some way? i kinda like how it opens so i would like to keep that for this launcher and then again its not a big deal but still the last thing i could improve on in this one function wise
2 sort the list of added links by alphabet in ListBox can this be done automatically ? or do i just need to insert at right place?
3 can you overlay images in gui in such a way you can still click on stuff? so i could use images as a color tool to make for example a box in yellow for all my shortcuts for... blue for shortcuts type... and so on?
the one thing that annoys me in gui is its ugly buttons shining at me, ive looked into that but its above my head for now all the color stuff seams to be complicated.
feel free to just point me to a tut or so you've helped me so much already thank you i appreciate it